[Python_Error] TypeError: list indices must be integers or slices, not tuple
본 포스팅은 업무 중 발생했던 오류들을 예시를 통해 어떻게 해결을 하는지 작성하고자 합니다. TypeError: list indices must be integers or slices, not tuple 해당 오류는 list 형식의 데이터를 numpy처럼 사용하고자 했을 때 자주 보게 되는 오류입니다. 아래 예시와 같이 list가 2D 형태이고 첫 번째 축이 아닌 두 번째 이상 축에 인덱싱을 하고자 할 때 발생했습니다. m = [[0, 4], [1, 0], [2, 2], [3, 3], [4, 1]] m[:,1] """ --------------------------------------------------------------------------- TypeError Traceback (most rec..
2023. 2. 15.