I have a Pandas Dataframe as below:
itm Date Amount 67 420 2012-09-30 00:00:00 6521168 421 2012-09-09 00:00:00 2942469 421 2012-09-16 00:00:00 2987770 421 2012-09-23 00:00:00 3099071 421 2012-09-30 00:00:00 6130372 485 2012-09-09 00:00:00 7178173 485 2012-09-16 00:00:00 NaN74 485 2012-09-23 00:00:00 1107275 485 2012-09-30 00:00:00 11370276 489 2012-09-09 00:00:00 6473177 489 2012-09-16 00:00:00 NaNWhen I try to apply a function to the Amount column, I get the following error:
ValueError: cannot convert float NaN to integerI have tried applying a function using math.isnan, pandas'.replace method, .sparse data attribute from pandas 0.9, if NaN == NaN statement in a function; I have also looked at this Q/A; none of them works.
How do I do it?