TypeError : ‘method’ object is not subscriptable

.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")

Leave a Comment