Trying to sort values in a dataframe based on a column [duplicate]

Solution 1:

.to_csv is a function/method, and you can't use [] after it, it must be ().

So the code should be:

....['Pokemon_name'].to_csv("new_pred_cp.csv")