Program language/Python

np.reshape에서 type error 날 때 해결 방법

COSMOSRKSI 2021. 5. 13. 11:15

numpy에서 reshape를 할 때 " typeerror order must be str not int " 라는 에러가 나오면 

 

아마 이 글을 보고 있는 분은 이렇게 코드를 쳤을 것이다.

 

np.reshape(xx0, xn*xn, 1)

 

여기서 맨 뒤 1을

 

np.reshape(xx0, xn*xn, 'F') 이렇게 'F'로 바꾸어 주면 해결된다.