Understanding inplace=True

后端 未结 11 1086
遥遥无期
遥遥无期 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:34

    inplace=True is used depending if you want to make changes to the original df or not.

    df.drop_duplicates()
    

    will only make a view of dropped values but not make any changes to df

    df.drop_duplicates(inplace  = True)
    

    will drop values and make changes to df.

    Hope this helps.:)

提交回复
热议问题