일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Java
- hive
- django
- Tkinter
- PANDAS
- list
- c#
- PySpark
- numpy
- math
- GIT
- Redshift
- Google Excel
- matplotlib
- SQL
- Excel
- gas
- Python
- PostgreSQL
- Github
- Mac
- 파이썬
- Google Spreadsheet
- dataframe
- Kotlin
- array
- Apache
- google apps script
- string
- Today
- Total
목록to_excel (2)
달나라 노트
pandas의 to_excel에서 startcol, startrow 옵션을 이용하면 어느 위치에 DataFrame을 위치시킬지 결정할 수 있습니다. import pandas as pd dict_test = { 'col1': [1, 2, 3], 'col2': ['a', 'b', 'c'], 'col3': [1234, 2817, 209183], } df_test = pd.DataFrame(dict_test) xlsx_writer = pd.ExcelWriter('test.xlsx', engine='openpyxl') df_test.to_excel(xlsx_writer, sheet_name='test1', startcol=2, startrow=3) xlsx_writer.close() 위 코드의 결과는 다음과 같습..
DataFrame.to_excel &emp; DataFrame.to_csv &emp; pandas.ExcelWriter to_excel은 DataFrame 정보를 담아 xlsx 파일로 만들어주는 기능을 제공합니다. to_csv는 DataFrame 정보를 담아 csv 파일로 만들어주는 기능을 제공합니다. 먼저 test용 DataFrame을 생성합니다. import pandas as pd dict_1 = { 'col1': [1, 1, 1, 2, 3, 3, 3, 3, 4, 4, 5], 'col2': [1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 5], 'col3': [1, 2, 3, 2, 2, 3, 3, 3, 3, 4, 4] } df_1 = pd.DataFrame(dict_1) print(df_1) ..