I am sorting my data by the student id number. when I am explicitly giving the arguement inplace=True. I am getting following error-
ValueError: This Series is a view of some other array, to sort in-place you must create a copy
I want to save the sorted data to a file so I can not make inplace=False. I dont understand why its showing the error. here is my code-
df = pd.read_csv('/home/user/Documents/MOOC dataset test/students_info_assessment2.csv')
df = df.id_student.sort_values(inplace=True)
df = pd.DataFrame(df)
df.to_csv('/home/user/Documents/MOOC dataset test/students_info_assessment_sorted.csv')
what should I do?