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

26th Sep 2020, 10:11 AM
Даня Слобяк
Даня Слобяк - avatar
5 Answers
+ 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
26th Sep 2020, 10:44 AM
Lothar
Lothar - avatar
+ 1
Rather, Cannot convert non-finite values ​​(NA or inf) to integer
26th Sep 2020, 10:44 AM
Даня Слобяк
Даня Слобяк - avatar
+ 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
26th Sep 2020, 10:50 AM
Даня Слобяк
Даня Слобяк - avatar
0
It gave an error: Unable to convert non-finite values ​​(NA or inf) to integers
26th Sep 2020, 10:43 AM
Даня Слобяк
Даня Слобяк - avatar