0
problems when converting data from float64 to int64 in python for cross validation
I was preparing data for testing one of the training models, but the key attribute "rating" is in float64 format, but the cross validation only needs int, I tried to translate it in the usual way (anime ['raiting']. Astype (int64)) but ran into an error , on the Internet I found this solution, but now it writes to me that the pandas does not contain the int64 attribute, below is my code crudely transferred from Jupiter Notebook https://code.sololearn.com/c15gLQtjYc25/?ref=app
5 Antworten
+ 3
May be a view to pandas documentation for this specific task can help you:
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.astype.html
+ 1
+ 1
Rather, Cannot convert non-finite values (NA or inf) to integer
+ 1
I tried to reproduce the code as indicated in the documentation, if I understood correctly, but it gives me the same error, it appears anyway if I have a data type in ``, maybe I understood something wrong there
0
It gave an error: Unable to convert non-finite values (NA or inf) to integers