일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Apache
- Python
- django
- Tkinter
- 파이썬
- numpy
- Java
- PostgreSQL
- Redshift
- hive
- PANDAS
- gas
- math
- PySpark
- SQL
- Kotlin
- string
- matplotlib
- array
- c#
- GIT
- Mac
- Google Spreadsheet
- Github
- dataframe
- google apps script
- Google Excel
- list
- Excel
- Today
- Total
목록openpyxl (10)
달나라 노트
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/b4qAOt/btsFhqligsr/HUBZZKFlfKoKjfBQ6kEhV1/img.png)
worksheet 객체의 column_dimensions, row_dimensions를 이용하면 column width, row height을 조절할 수 있습니다. 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', index=False) worksheet = xlsx_writer.sheets['test1'..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/SHko5/btsFisv99uX/Sral2DhwjwOYzRTIc7IOF1/img.png)
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() 위 코드의 결과는 다음과 같습..