I would like to change the default behavior of pandas
to fill empty elements with something other that float('nan')
, without modifying the source code. I can easily replace NaN
after I've created a DataFrame
using DataFrame.fillna()
, but instead would like to change this behavior for all DataFrames
before they are even instantiated.
In my application, I use a library that for some reason crashes if a float('nan')
appears in Python
, so my idea is to change the pandas
default fill so that float('nan')
never appears. Is there a way to change the default behaviour?
EDIT:
I tried pd.set_option('mode.use_inf_as_na', True)
to no avail
https://pandas.pydata.org/pandas-docs/stable/user_guide/options.html
https://pandas.pydata.org/pandas-docs/stable/user_guide/missing_data.html