UltiMaker uses functional, analytical and tracking cookies. Tracking cookies enhance your experience on our website and may also collect your personal data outside of Ultimaker websites. If you agree with the use of tracking cookies, click “I agree, continue browsing”. You can withdraw your consent at any time. If you do not consent with the use of tracking cookies, click “Refuse”. You can find more information about cookies on our Privacy and Cookie Policy page.
The ValueError: cannot convert float NaN to integer raised because of Pandas doesn't have the ability to store NaN values for integers.
From Pandas v0.24, introduces Nullable Integer Data Types which allows integers to coexist with NaNs. This does allow integer NaNs . This is the pandas integer, instead of the numpy integer. So, use Nullable Integer Data Types (e.g. Int64).
df['x'].astype('Int64')
NB: You have to go through numpy float first and then to nullable Int32, for some reason.
Another solution is Using numpy.nan_to_num(). The numpy.nan_to_num() returns an array or scalar replacing Not a Number ( Not A Number ) with zero, positive_infinity with a very large number and negative_infinity with a very small (or negative) number.
If you are not satisfied with the above solutions, you need to say what you want to do with NANs . You can either drop those rows df.dropna() or replace nans with something else (0 for instance: df.fillna(0) )
All "5.X.X" versions of Cura crash a lot (OSX 12.4)
in UltiMaker Cura
Posted
The ValueError: cannot convert float NaN to integer raised because of Pandas doesn't have the ability to store NaN values for integers.
From Pandas v0.24, introduces Nullable Integer Data Types which allows integers to coexist with NaNs. This does allow integer NaNs . This is the pandas integer, instead of the numpy integer. So, use Nullable Integer Data Types (e.g. Int64).
df['x'].astype('Int64')
NB: You have to go through numpy float first and then to nullable Int32, for some reason.
Another solution is Using numpy.nan_to_num(). The numpy.nan_to_num() returns an array or scalar replacing Not a Number ( Not A Number ) with zero, positive_infinity with a very large number and negative_infinity with a very small (or negative) number.
If you are not satisfied with the above solutions, you need to say what you want to do with NANs . You can either drop those rows df.dropna() or replace nans with something else (0 for instance: df.fillna(0) )