반응형
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
- 파이썬
- list
- Github
- Google Spreadsheet
- array
- c#
- hive
- Kotlin
- django
- string
- PySpark
- PANDAS
- Google Excel
- numpy
- Excel
- Java
- Apache
- SQL
- PostgreSQL
- Redshift
- google apps script
- Mac
- Python
- Tkinter
- math
- matplotlib
- GIT
- dataframe
- gas
Archives
- Today
- Total
목록rename (2)
달나라 노트
Python os : rename (file 이름 바꾸기)
import os os.rename("text.txt", "test.txt") rename은 명시된 file의 이름을 변경하는 역할을 합니다. 위 코드는 해당 코드가 실행되는 디렉토리와 동일한 위치에 있는 text.txt라는 파일의 이름을 test.txt로 변경합니다.
Python/Python os
2020. 12. 23. 03:41
Python Pandas : pandas.DataFrame.rename
pandas.DataFrame.rename rename은 DataFrame의 column name이나 row index name을 변경해주는 역할을 합니다. 먼저 테스트용 DataFrame을 생성합시다. import pandas as pd dict_1 = { 'col1': [1, 2, 3, 4, 5], 'col2': [6, 7, 8, 9, 10], 'col3': [11, 12, 13, 14, 15] } df_1 = pd.DataFrame(dict_1) print(df_1) print(type(df_1)) - Output col1 col2 col3 0 1 6 11 1 2 7 12 2 3 8 13 3 4 9 14 4 5 10 15 이제 위에서 생성한 DataFrame의 컬럼명을 바꿔봅시다. import pa..
Python/Python Pandas
2020. 11. 24. 15:53