I'm trying to calculate the mean of a column in the data frame.
I played with two approaches: 1. converting column to an array and calculating mean using numpy.mean() 2. used pandas.mean() on the column itself However they return different values.
import numpy as np
col1= subdf['V12']
col1=np.array(col1)
col1_mean= col1.mean()
col1_mean
This returns: -1.2549951995448174e-15
import numpy as np
col1= subdf['V12']
col1_mean= col1.mean()
col1_mean
This returns: -1.81065810647492e-15
Why are the two means different?