반응형
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 |
Tags
- list
- google apps script
- Python
- PySpark
- Github
- Google Excel
- Apache
- matplotlib
- Google Spreadsheet
- 파이썬
- c#
- string
- GIT
- dataframe
- Excel
- numpy
- gas
- django
- math
- Tkinter
- Java
- Redshift
- PostgreSQL
- PANDAS
- SQL
- hive
- Kotlin
- Mac
- array
Archives
- Today
- Total
목록StringIO (1)
달나라 노트
Python io : StringIO (comma separate csv type string 생성, DataFrame을 csv type string으로 변환하기)
아래와 같은 DataFrame이 있다고 생각해봅시다. import pandas as pd from io import StringIO dict_test = { 'id': [1, 2, 3, 4, 5], 'name': ['banana', 'apple', 'melon', 'peach', 'grape'], 'price': [3500, 16000, 15000, 25000, 5800] } df_test = pd.DataFrame(dict_test) print(df_test) -- Result id name price 0 1 banana 3500 1 2 apple 16000 2 3 melon 15000 3 4 peach 25000 4 5 grape 5800 만약 위 DataFrame을 comma(,)로 나눠진 csv ..
Python/Python ETC
2023. 10. 18. 21:59