๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Python/Pandas

[Python] Pandas - Dataframe, json ์œผ๋กœ ๋ณ€๊ฒฝ

๋ฐ˜์‘ํ˜•
import pandas as pd

df = pd.DataFrame({'a':152.0054343543,
                   'b':0.0070054423423,
                   'c':-7.54543543E-07,
                   'd':2.50282237391414E-11}, index=[0])

df.to_json(orient='records', double_precision=15)

- to_json ์ด์šฉ

- ์†Œ์ˆซ์  ์ž๋ฆฌ์ˆ˜ ๊ธฐ๋ณธ 10์ž๋ฆฌ๋ผ์„œ 15๋กœ ์„ค์ •ํ•จ

 

date_format

 

 

 

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_json.html

 

pandas.DataFrame.to_json — pandas 1.1.0 documentation

The time unit to encode to, governs timestamp and ISO8601 precision. One of ‘s’, ‘ms’, ‘us’, ‘ns’ for second, millisecond, microsecond, and nanosecond respectively.

pandas.pydata.org

๋ฐ˜์‘ํ˜•