반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Apache
- 파이썬
- dataframe
- gas
- Tkinter
- Excel
- string
- list
- math
- GIT
- Google Spreadsheet
- Github
- Google Excel
- Python
- array
- numpy
- SQL
- PANDAS
- PySpark
- PostgreSQL
- Redshift
- c#
- Mac
- matplotlib
- Java
- Kotlin
- google apps script
- django
- hive
Archives
- Today
- Total
목록convert Series to json (1)
달나라 노트
Python Pandas : to_json (Series 또는 DataFrame을 json 형태로 변환하기)
Python Pandas에는 DataFrame이나 Series를 json 형태로 변환해주는 to_json이라는 method가 있습니다. 예시를 보시죠. import pandas as pd dict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': ['a', 'b', 'c', 'd', 'e'], 'col3': ['Apple', 'Banana', 'Watermelon', 'Grape', 'Melon'] } df_test = pd.DataFrame(dict_test) print(df_test) json_test = df_test.to_json() print(json_test) -- Result col1 col2 col3 0 1 a Apple 1 2 b Banana 2 3 c Water..
Python/Python Pandas
2021. 9. 14. 19:01