I updated Python to 3.11.6 from 3.9 and starting to get this error:
**FutureWarning:
Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '1000000' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.**
The line where it is warning is:
df.fillna('1000000', inplace=True)
Read stackoverflow hits like Solving incompatible dtype warning... and DeprecationWarning: The default dtype for empty Series... and many more.
But still not getting grasp of the issue and how to fix it. The code still works, it is just producing this warning message. Hoping someone can help me looking at that single line code above instead of a reproduceable code.
Thanks.
The code still works, it is just producing this warning message. Trying to see how can I get rid of this warning.
You want a different
fillnastrategy for different column types.'1000000'is a string while1000000is an int and1000000.0is a float. Placing strings in afloat64column will produce your error. You may iterate over the columns, get the column type and fill NAs appropriately.