반응형
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
- hive
- math
- PySpark
- 파이썬
- Mac
- Redshift
- list
- matplotlib
- django
- string
- Apache
- Kotlin
- Python
- dataframe
- Google Excel
- Tkinter
- numpy
- array
- Google Spreadsheet
- SQL
- PostgreSQL
- gas
- google apps script
- PANDAS
- GIT
- Excel
- Github
- c#
- Java
Archives
- Today
- Total
목록astype (1)
달나라 노트
Python Pandas : astype (DataFrame의 컬럼 Data type 바꾸기) & dtype(Series의 Data type 추출)
Pandas에서는 DataFrame에 있는 Column들의 Data type을 바꾸기 위해 astype이라는 method를 제공합니다. import pandas as pd dict_test = { 'col1': [1, 2, 3, 4, 5], 'col2': [1.0, 2.0, 3.0, 4.0, 5.0], 'col3': ['1.2', '2.3', '3.4', '4.5', '5.6'], } df_test = pd.DataFrame(dict_test) print(df_test) print(type(df_test)) print('col1 dtype :', df_test['col1'].dtype) print('col2 dtype :', df_test['col2'].dtype) print('col3 dtype :',..
Python/Python Pandas
2021. 1. 6. 13:21