Let's consider the following simple csv file
end_beat
2.989583333
1.989583333
2.989583333
Pandas Approach
When I try to use pandas to read this csv file with the following code
import pandas as pd
df = pd.read_csv('debug.csv')
print(df['end_beat'][1])
I got
1.9895833330000001
Python csv library approach
However, when I use another method to read the data, everything is fine
import csv
with open('debug.csv') as f:
df = csv.DictReader(f)
next(df)['end_beat']
print(next(df)['end_beat'])
1.989583333
Only the result returned by pandas has this problem, how to get rid of the extra zeros?