Hello!
First of all reason why this problem occurs is as Pandas is expecting the data values to be list values or dict values. I don't know what is your values exactly however, you can give the dataframe object index parameter to get rid of this simple problem.
Firstly create a list of arbitrary numbers
numbers = pd.Index(range(max(y_test, y_pred))
than add this line to use these indexes.
df = df.set_index(numbers)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.