I'm not sure how to read in csv data using Pandas read_csv without having the data rounded up. Here's the first few rows of the csv (opened in Excel, where the Excel column type is Number)
When I read this CSV into my Jupyter Notebook using Pandas, both columns are being rounded up. I tried using the option float_precision = 'round_trip' and also first reading the columns in as str then converting to float, but once converted to float, the numbers are rounded up again. I made sure that my Jupyter Notebook display precision is greater than two.
How do I read this data in while preserving the precision?
This is what the csv file looks like in Xcode
I first read in the csv with the following code
CPI = pd.read_csv('CPI.csv', dtype={'Year': str, 'Annual_Avg': np.float64 , 'Annual_Percent_Change': np.float64})
Afterwards, the dataframe looks like this:
After closing out my kernel and restarting Jupyter, I'm now seeing the decimals displayed again. I don't know why it was initially rounding, it now looks ok. Should I now delete this post? Not sure what the stackoverflow protocol is if you've 'solved' your own question.