-
📌 오류가 발생한 코드
import numpy as np A=np.array([[2,3,4], [4,8,2], [1,2,1]]) print("A: "+A[1,]) #여기서 문제 발생
📌 에러명
numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('<U3'), dtype('int32')) -> None
즉, array와 str을 동시에 사용할 수 없다는 것!
🔎 최종적인 결정
: 각각 나누어서 작성하였다!
print("A에서 2행 구하기") print(A[1,])
📌 참고 주소
'프로그래밍 > 에러' 카테고리의 다른 글
[협업] GitDesktop Pull과 Push 충돌 (0) 2022.03.20 [Unity/2D] Canvas 사이즈가 지나치게 큰 경우 (8) 2022.03.14 [C#] 프로젝트 켤 때 발생한 에러 (0) 2022.03.03 [Unity/2D] 씬 전환 불가능 (0) 2022.02.28 [Ubuntu] ctrl+D 작동되지 않음 (0) 2021.12.05 [Python] 출력시 int와 str을 함께 사용할 때 발생 (0) 2021.09.06 [Visual Studio & SourceTree] 깃 허브 한글깨짐 해결 (0) 2021.09.01 [Android] 버전 업데이트관련 오류 발생 및 해결 (0) 2021.08.06 댓글