Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from decimal import Decimal
- import pandas as pd
- def decimal_from_value(value):
- return Decimal(value)
- df = pd.read_csv(filename, converters={'values': decimal_from_value})
- # converter set values type to "object" (Decimal), not default float64
- print(df.dtypes)
- # values object
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement