반응형
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
- PostgreSQL
- Python
- SQL
- Github
- math
- PANDAS
- gas
- dataframe
- django
- Mac
- Java
- string
- matplotlib
- Google Excel
- Apache
- Redshift
- Excel
- array
- 파이썬
- PySpark
- Google Spreadsheet
- numpy
- google apps script
- GIT
- c#
- list
- hive
- Tkinter
- Kotlin
Archives
- Today
- Total
목록Series.to_list (1)
달나라 노트
Python Pandas : to_list (Series를 list type으로 만들기)
Pandas에서 제공하는 to_list method는 Series에 적용할 수 있으며 적용된 Series를 list 형태로 변환해주는 역할을 합니다. import pandas as pd dict_main = { 'col1': [1, 2, 3, 4, 5, 6], 'col2': ['alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta'] } df_main = pd.DataFrame(dict_main) print(df_main) list_col2 = df_main.loc[:, 'col2'].to_list() print(list_col2) list_col2 = list(df_main.loc[:, 'col2']) print(list_col2) -- Result col1 col..
Python/Python Pandas
2021. 10. 27. 19:35