Reputation: 3938
In my csv file that I wish to import, I have a column Timestamp
with nanoseconds precision:
34200.154875632 and so on.
When I write:
dfr = pd.read_csv(files,index_col=None,usecols=['Timestamp','Price'], header=0,dtype=np.float)
df=DataFrame(dfr)
I do not get a DataFrame
with a column of Timestamp
with all nice decimals...only six. I tried to play around with the input dtype=np.float
but no result. What's the missing argument in pd.read_csv
to have all nine decimals?
Upvotes: 2
Views: 2712
Reputation: 10397
This is probably due to the print precision of pandas. Look into pandas.set_printoptions.
It looks like pandas.set_printoptions is now deprecated in v0.13, it seems to use pandas.set_option
Upvotes: 1
Reputation: 3938
I found the correct code
import Pandas
pd.options.display.float_format = '{:20,.2f}'.format
Upvotes: 2