简体   繁体   中英

How to read big numbers(Scientific notation) of CSV file through pandas?

Through pandas library, I'm trying to read CSV file, there is a column having scientific notation values. I'm trying to convert those 7.87899E+11 values into an integer using the below code but it gives output values like 787899000000000 and in CSV the actual value is 787898987690 , I need the same o/p value.

Here is the code:

import pandas as pd
df = pd.read_csv('FilePath\\Vaccination_Data.csv')
pd.set_option('display.max_columns', None)
pd.set_option('display.float_format', lambda x: '%.2f' % x)
print(df)

This worked for me. pd.set_option('display.float_format', lambda x: '%.3f' % x)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM