Mean of a column is an NaN value

145 Views Asked by At

I have a dataset consisting of 19 Million data. And I am trying to take the mean and std of a column called "volume". So far I have checked the data with those corresponding lines and got the results:

df.volume.isnull().sum()

0

Here are the statistics of that column (log scaled to prevent underflow issues)

df.volume.describe()

count = 1.92e+07

min = 0

median = 6.51

max = 10.9

mean = NaN

std = 0.00

And here is a boxplot of the volume column of dataset

enter image description here

1

There are 1 best solutions below

0
On

If I had to guess without seeing the data - when you took the log of the values there was probably a 0 value(s) in your data which will cause an error when taking the mean.

You could try using the log1p() function in pandas.