Np.nan is not allowed

What is the recommended way of writing a python dataframe with np.nan elements? Both protocol=“line” and “json” choke on it. Is the only option to fill nans with some constant?

So basically, the problem is, it takes an awful long time if I have to select each dataframe column, remove NAs and push it into influxdb. I have dataframes with ~3500 columns.