Notice
Recent Posts
Recent Comments
Link
아미(아름다운미소)
pandas 컬럼명에서 '_calc' 접미사 제거 본문
import pandas as pd
# 예시 데이터프레임 생성
data = {
'Name_calc': ['Alice', 'Bob', 'Charlie'],
'Age_calc': [25, 30, 35],
'City_calc': ['New York', 'Los Angeles', 'Chicago']
}
df = pd.DataFrame(data)
# 컬럼명에서 '_calc' 접미사 제거
df.columns = df.columns.str.replace('_calc$', '', regex=True)
print(df)
'랭귀지 > SWIFT' 카테고리의 다른 글
pandas dataframe 자료형 변경 (0) | 2024.06.11 |
---|---|
pandas list 형태로 컬럼명 지정하고 list 컬럼에 접미사 _calc 일괄 붙여서 컬럼 rename 후 일괄 fillna 적용 (0) | 2024.06.10 |
pandas outer join 이름변경후 두열차감 (0) | 2024.06.09 |
CocoaPods 사용하기 (0) | 2018.07.10 |
[iOS Swift] Textfield 키보드 내리기 (0) | 2018.07.06 |
Comments