반응형
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
- Redshift
- matplotlib
- numpy
- Github
- math
- Tkinter
- django
- GIT
- PostgreSQL
- c#
- Java
- array
- Google Spreadsheet
- string
- Excel
- gas
- SQL
- Kotlin
- PySpark
- hive
- PANDAS
- dataframe
- google apps script
- 파이썬
- Presto
- Google Excel
- Apache
- list
- Python
Archives
- Today
- Total
목록DataFrame rows (1)
달나라 노트
Python Pandas : iterrows (DataFrame의 행 반복하기)
DataFrame을 다루다보면 DataFrame에 있는 하나하나의 행을 참조하여 for loop를 돌리는 등의 경우가 발생합니다. 이럴때에는 여러 가지 방법이 있지만 그 중에서 pandas에서 제공하는 iterrows를 사용해봅시다. import pandas as pd dict_1 = { 'col1': [4, 1, 5, 3, 2], 'col2': [6, 7, 8, 9, 10], 'col3': [11, 12, 13, 14, 15], 'col4': [16, 17, 18, 19, 20] } df_1 = pd.DataFrame(dict_1) print(df_1) print(df_1.iterrows()) -- Result col1 col2 col3 col4 0 4 6 11 16 1 1 7 12 17 2 5 8 1..
Python/Python Pandas
2021. 8. 23. 12:24