You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not sure this is a good idea because then you can easily have silent errors when you just say misspelled something, e.g.
In [8]: df = DataFrame(randn(10,2),columns=['foo','bar'])
In [9]: df.drop('bah')
ValueError: labels ['bah'] not contained in axis
If drop is silent then this woulld be ok, but a no-op.
as for the inplace suggestion, that is being added in 0.14, however, this does not speed anything up,
just makes the method work inplace. Most operations require a copy to avoid data aliasing.
For manytimes, just want to make sure certain columns not exist any more in a dataframe after the drop, no matter the cols exists or not in the input df, just don't want to check.
Current dataframe.drop will raise error for below code for 'non_exist_in_df_col' :
But below is better for it can accept it.
And it will be better to add an 'inplace' option to speed up the repeatly df self-assignment.
The text was updated successfully, but these errors were encountered: