
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
2주차 'pandas 기초' 수업을 듣던중에 not supported between instances of 'str' and 'int' 라는 메세지가 뜹니다
df[df['age'] > 20]
로 써서 해보았습니다.
제 생각에는 'age'가 문자열로 취급이 되는거 같은데 왜 이렇게 될까요?
데이타를 넣을 때도
'age':[15,12,20,25] 이런 식으로 넣었습니다.
혹시 행 데이터 추가할때에 age를 '30' 이런식으로 넣은것 같은데 이것 때문에 전부 문자열로 취급이 되는건가요?
이럴 때는 어떻게 찾으면 되는지 까지 알려주시면 감사하겠습니다.
작성한 코드 및 에러 메세지
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-77-c0654caa315e> in <module> ----> 1 df[df['age'] > 20]
5 frames
/usr/local/lib/python3.8/dist-packages/pandas/_libs/ops.pyx in pandas._libs.ops.scalar_compare()
TypeError: '>' not supported between instances of 'str' and 'int'
