728x90
반응형
마주하게 된 오류 메시지이다.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In [53], line 1
----> 1 sum_of_students_by_class = sum_of_students_by_class.drop['user_id']
2 sum_of_students_by_class
TypeError: 'method' object is not subscriptable
그리고 상기 오류를 유발한 코드 위치가 오류 메시지에 보면 1행이라고 나와 있다. 이에 대한 오류를 잡은 정상 코드는 다음과 같다.
sum_of_students_by_class = sum_of_students_by_class.drop('user_id')
sum_of_students_by_class
대괄호[ ]와 괄호( ) 사용은 언제나 헷갈린다!!!
728x90
반응형
SMALL
'Python' 카테고리의 다른 글
파이썬 코딩 High Level vs. Low Level (0) | 2023.01.18 |
---|---|
파이썬 코딩 스타일 (0) | 2023.01.17 |
[Jupyter Notebook] UserWarning: Glyph 49688 (\N{HANGUL SYLLABLE SU}) missing from current font. (0) | 2022.12.07 |
[Jupyter Notebook] TypeError: barplot() got multiple values for argument 'data' (0) | 2022.12.06 |
[Jupyter Notebook] ValueError: Cannot set a DataFrame with multiple columns to the single column ma2 (0) | 2022.11.28 |