As the title describes, when I try to import data from a .csv file, pandas takes it upon itself to modify one of my data columns significantly. My .csv file looks roughly like this:
Date, Price
2015-02-03 17:00:00, 20.95
2015-02-04 17:00:00, 20.927
2015-02-05 17:00:00, 21.322
2015-02-06 17:00:00, 22.158
...
So when I try to import this csv file, this is what I get:
In[2]: fname01 = os.path.join("Data", "myData.csv")
dfMyData = pd.read_csv(fname02, usecols=["Date", "Price"], sep = ',')
print(dfMyData)
print(dfMyData.dtypes)
Out[2]:
Date Price
0 2015-02-03 17:00:00 2.095000e+01
1 2015-02-04 17:00:00 2.092700e+01
2 2015-02-05 17:00:00 2.132200e+01
3 2015-02-06 17:00:00 2.215800e+01
Date object
Price float64
dtype: object
As you can see in the Price column, pandas moves the decimal point to the left and goes crazy with the rest of the decimals. At least the type is still float64.
Can anyone tell me what is going on here, and how I can fix it?
Any help is greatly appreciated.