Can df.reset_index(drop=true) be set as default in Python Pandas? -
when slicing dataframe in python pandas remembers index of rows. if don't want can use df.reset_index(drop=true). there way can set default? want have indexes reset.
also situations want remember index?
thanks
you can change default values set func_defaults
:
import pandas pd import numpy np pd.dataframe.reset_index.im_func.func_defaults = (none, true, false, 0, '') df = pd.dataframe(np.random.randint(0, 10, (10, 4)), columns=list("abcd"), index=np.ones(10)) df.reset_index()
Comments
Post a Comment