반응형
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 |
Tags
- Google Excel
- PostgreSQL
- Excel
- math
- Github
- PySpark
- hive
- Redshift
- matplotlib
- google apps script
- gas
- PANDAS
- array
- GIT
- list
- django
- Python
- 파이썬
- Google Spreadsheet
- string
- Java
- SQL
- dataframe
- Mac
- c#
- numpy
- Kotlin
- Tkinter
- Apache
Archives
- Today
- Total
목록width (1)
달나라 노트
Python Pandas & openpyxl : column width autofit (column 너비 자동맞춤)
데이터를 다루다 보면 cell에 길이가 긴 텍스트가 들어갈 수도 있습니다. 이런 경우 column의 너비를 조절해야하는 상황이 생길 수 있는데, 문제는 일일이 컬럼마다 다 너비를 지정해주는건 한계가 있습니다. 그래서 openpyxl의 기능을 이용하여 column width autofit 기능을 구현해봅시다. import pandas as pd dict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': ['apple', 'banana', 'aspidfhadinfgkjadnfkskdjnv', 'drizzle', 'electron'], 'col3': [1234, 0.27383720, 39372, None, 102947291.293472], 'col4': [0.9, 0.5238, 0.1..
Python/Python Pandas
2024. 2. 26. 23:28