반응형
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
- Github
- Java
- hive
- list
- Excel
- Google Spreadsheet
- Kotlin
- array
- PySpark
- Mac
- GIT
- Apache
- django
- matplotlib
- Tkinter
- PostgreSQL
- google apps script
- Google Excel
- c#
- Redshift
- Python
- gas
- string
- math
- SQL
- numpy
- dataframe
- 파이썬
- PANDAS
Archives
- Today
- Total
목록pretty print (1)
달나라 노트
Python Pandas : Tabulate, DataFrame을 가독성 좋게 print하기 (tabulate library 이용. pretty print dataframe)
tabulate을 이용하여 DataFrame을 terminal에서 더 가독성 좋게(이쁘게) 출력하는 방법을 알아봅시다. import pandas as pd dict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': ['Apple', 'Banana', 'Watermelon', 'Grape', 'Melon'], 'col3': ['a', 'b', 'c', 'd', 'e'], } df_test = pd.DataFrame(dict_test) print(df_test) 위 코드를 실행해보면 그 결과로 아래 이미지와 같은 내용이 출력됩니다. 정상적으로 DataFrame이 출력되긴 했죠. 그러나 가독성이 그닥 좋아보이진 않습니다. 지금 예시로 사용된 DataFrame은 굉장히 간단해서 이것만으..
Python/Python Pandas
2021. 10. 23. 14:59