I've got a large dataframe where each column have different start dates, as such I've used fillna to plug the holes in the dataframe with zeros instead of nan values. But when I'm trying to normalise the data both the mean and std dev function gives me nan values. I ran isna().values.any() to see if anything had been missed but it come back false. Tried changing it to be 0 ddof as well as I read someplaces that might help.
I also tried to add skipna=True to ensure it skips nan value if there are any, but once again no luck.
Lastly, I've also check that it's all float values and no issues there. Any idea what it could be cause I can't figure it out....
data.astype(float)
print(data.isna().values.any())
#df2.stack().dropna().mean()
std = data.stack().std(skipna=True, ddof=0)
print(std)
mean = data.stack().mean(skipna=True)
print(mean)
data = (data-mean)/std
print(data)
In the screenshot below, the two first False are from isna() queries. The two nan values are from mean and std and the dataframe below is clearly cause it's tried to normalise against these values.