Skip to content

Instantly share code, notes, and snippets.

@Coldsp33d
Last active December 9, 2019 03:51
Show Gist options
  • Save Coldsp33d/a598c942afeac7150a7a24950ed14310 to your computer and use it in GitHub Desktop.
Save Coldsp33d/a598c942afeac7150a7a24950ed14310 to your computer and use it in GitHub Desktop.
List of functions that support in-place modification
# Reference: https://github.com/pandas-dev/pandas/issues/16529
(Series/DataFrame).drop
(Series/DataFrame).drop_duplicates
(Series/DataFrame).dropna
DataFrame.set_index (with drop=False wouldn't change the data, but that doesn't seem the main use case)
DataFrame.query
DataFrame.eval
(Series/DataFrame).sort_values
(Series/DataFrame).sort_index
(Series/DataFrame).clip
(Series/DataFrame).where
(Series/DataFrame).{fillna, ffill, bfill}
(Series/DataFrame).rename_axis
(Series/DataFrame).reset_index
(Series/DataFrame).replace
(Series/DataFrame).set_axis
(Series/DataFrame).mask
(Series/DataFrame).interpolate
DataFrame.rename
Index.rename
Index.set_names
MultiIndex.set_levels
MultiIndex.set_labels
pandas.core.resample.Resampler.interpolate
pandas.eval (with inplace=False the value is not returned but set to an argument target)
(Series/DataFrame/Panel).clip_lower
(Series/DataFrame/Panel).clip_upper
pandas.Panel.clip
pandas.Panel.drop
pandas.Panel.dropna
pandas.Panel.sort_index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment