일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- numpy
- Google Spreadsheet
- PostgreSQL
- Google Excel
- SQL
- GIT
- Excel
- Tkinter
- matplotlib
- Mac
- gas
- Kotlin
- Apache
- c#
- array
- PySpark
- string
- math
- Redshift
- 파이썬
- Github
- PANDAS
- Java
- dataframe
- list
- hive
- django
- google apps script
- Python
- Today
- Total
목록Python/Python Pandas (72)
달나라 노트
pandas DataFrame에서 어떻게 Percentile Rank를 계산하는지 봅시다. (백분위, 백분위수에 대한 이해를 기반으로 합니다. 백분위 관련 개념 습득을 위해서는 아래 글을 참고하면 좋습니다.) https://cosmosproject.tistory.com/826 백분위(Percentile Rank), 백분위수(Percentile), 사분위수(Quartile) 알아보기 수학, 통계, 데이터 분석 등 다양한 곳에서 백분위라는 말이 쓰입니다. 수능 성적을 받아도 백분위라는 것이 있죠. 이 백분위라는 것이 무엇이고, 왜/어떻게 쓰이며, 어떻게 계산할 수 있는지 알 cosmosproject.tistory.com import pandas as pd dict_test = { 'col1': [ 10, 2..
openpyxl의 alignment를 이용하면 셀에 적힌 텍스트의 정렬을 할 수 있습니다. import pandas as pd from openpyxl.styles import Alignment dict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': ['apple', 'banana', 'cloud', 'dream', 'electron'], 'col3': [1234, 0.27383720, 39372, None, 102947291.293472], 'col4': [0.9, 0.5238, 0.13, 0.0028, 1024.29278], } df_test = pd.DataFrame(dict_test) xlsx_writer = pd.ExcelWriter('test.xlsx', engin..
데이터를 다루다 보면 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..
worksheet 객체의 columns 속성을 이용하면 현재 담겨진 dataset의 모든 column에 대한 객체를 얻어옵니다. 각각의 column 객체는 해당 column에 존재하는 cell 객체들이 tuple에 담겨있는 형태로 존재합니다. import pandas as pd dict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': ['apple', 'banana', 'cloud', 'drizzle', 'electron'], 'col3': [1234, 0.27383720, 39372, None, 102947291.293472], 'col4': [0.9, 0.5238, 0.13, 0.0028, 1024.29278], } df_test = pd.DataFrame(dict_test..