Data Analysis/Python
[Python] 엑셀에서처럼 표 내 바꾸기 기능
[지현]
2021. 2. 9. 19:19
1
2
3
4
5
6
7
|
movies1['year'] = movies1['title'].str.extract('(\(\d\d\d\d\))')
movies1.isna().sum() #에러 유무 확인
movies1.dropna(axis=0, inplace=True)
movies1['year'] = movies1['year'].apply(lambda x: str(x).replace('(','').replace(')',''))
movies1.head()
|