[Python_Error] TypeError: only integer scalar arrays can be converted to a scalar index


[Python_Error] TypeError: only integer scalar arrays can be converted to a scalar index

본 포스팅은 업무 중 발생했던 오류들을 예시를 통해 어떻게 해결을 했는지 적을 예정이다. TypeError: only integer scalar arrays can be converted to a scalar index list index에 scalar 가 아닌 np.array가 들어갔을 때 발생하는 오류이다. [예시] import numpy as np rand_cube_3D = np.random.randint(0,10,size=[5,5,5]) print(rand_cube_3D) """ array([[[3, 1, 4, 8, 9], [7, 1, 2, 8, 3], [4, 9, 0, 6, 9], [8, 9, 9, 4, 0], [5, 0, 5, 8, 1]], [[9, 4, 2, 9, 2], [6, 7, 6, 8..


원문링크 : [Python_Error] TypeError: only integer scalar arrays can be converted to a scalar index