Understanding inplace=True

后端 未结 11 1113
遥遥无期
遥遥无期 2020-11-22 03:25

In the pandas library many times there is an option to change the object inplace such as with the following statement...

df.dropna(axis=\'index\         


        
11条回答
  •  被撕碎了的回忆
    2020-11-22 03:45

    As Far my experience in pandas I would like to answer.

    The 'inplace=True' argument stands for the data frame has to make changes permanent eg.

        df.dropna(axis='index', how='all', inplace=True)
    

    changes the same dataframe (as this pandas find NaN entries in index and drops them). If we try

        df.dropna(axis='index', how='all')
    

    pandas shows the dataframe with changes we make but will not modify the original dataframe 'df'.

提交回复
热议问题