Pandas 전처리 연습(0)

SeongGyun Hong·2024년 10월 28일

빅데이터 분석기사

목록 보기
6/16

으으 왜 이렇게 실수가 많은거야 ㅠ

1. pd.to_datetime() 오류

target = info_channel[info_channel.ct > pd.datetime(2021-10-03)]

이게 왜 안 됐는고 보니...

먼저 datetime 안에 들어갈 때는 '' 홑 따옴표 가지고 들어가야하고

둘째로 pd.datetime() 이 아니라

pd.to_datetime() 이 맞다...

그러니까 정답은...
아래와 같은 것...
target = info_channel[info_channel.ct > pd.to_datetime('2021-10-03')]

2. 와,,, len() 미확인 실수

아니,,, 틀린게 없는데...

target = info_video[info_video['videoname'] == '공범 EP1']
print(target)

이게 자꾸 안 나와서 보니까...

target = info_video[info_video['videoname'] == ' 공범 EP1']
print(target)

이렇게 공범 EP1 해줘야 했었다...
공범 앞에 띄어쓰기 한 칸 해줬어야 했다고,,,,
와... 이렇게 한다고 진짜 ? ㅠㅠ
print(len(info_video.head(1).videoname[0]))
이렇게 체크해보고서야 알았다 하...

       
profile
헤매는 만큼 자기 땅이다.

0개의 댓글