← Back to team overview

yade-users team mailing list archive

Re: [Question #693071]: ValueError: cannot convert float NaN to integer

 

Question #693071 on Yade changed:
https://answers.launchpad.net/yade/+question/693071

linehammer@xxxxxxxxxxxxx posted a new comment:
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')

http://net-informations.com/ds/err/nan.htm

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.