# Your code here
a = time()
df.drop('x',axis=1,inplace=True)
print(time()-a)#0.02...
#imagine we got the values of column x again...
a = time()
del df['x']
print(time()-a)#0.0009...
#the del method is faster to delete the column in place...
I cant seem to locate the drop function anywhere or else I would commit it myself. What I am imagining is the drop would check if kwarg inplace is true, if it is, it would do something to drop the table, right?
If I am right, then cant we just replace the something with del dataframe[column_name]? I am not an expert programmer like y'all, so please do correct me if I am wrong...Thank you
pd.show_versions()0.23.0
Guys How do I make this an enhancement instead of issue?
drop is the canonical way to delete columns from a DataFrame. There is a discussion on SO which while old still touches on relevant aspects:
I'm not entirely clear on what you are after as you touch on a few points here, but if you wanted to just have a general discussion on this you'd be better served on the Gitter or mailing list.
Ok, thank you, sorry for disturbing