본문 바로가기
Error Note

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (9969,) + inhomogeneous part.

by ga.0_0.ga 2023. 7. 14.
728x90
반응형

- 전체 에러 문구 

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (9969,) + inhomogeneous part.

 

list 를 numpy 로 변환할 때 발생하는 에러입니다. x = [[1, 2], [3, 4, 5]] 처럼 list내에 서로 다른 길이의 리스트들이 존재하면 변환이 불가능하기 때문에 발생하는 에러입니다.

 

- 해결방법 

리스트들의 길이를 동일하게 맞춰주면 됩니다!

728x90
반응형

댓글