index Object immutable , therefore obj.index[2] = 10 This operation will report an error , But we can choose to reset the index .
reset_index(drop), Reassign the index value from 0 Index started , The original index becomes a column in the data , Column name is index. Function drop The parameter defaults to False, If order drop=True, It means to delete the original index column , Use it again inplace=True, The index reset operation is performed on the original data . namely reset_index(drop = True,inplace = True), Subsequent data will be indexed by default 0-n Index , And the original index does not exist as a data value , Does not exist as an index .