"NumPy foreach row"의 두 판 사이의 차이

(새 문서: ==개요== ;NumPy foreach row <syntaxhighlight lang='python' run> import numpy as np m = np.matrix([[101,102,103,104], [201,202,203,204], [301,302,303,3...)
 
2번째 줄: 2번째 줄:
;NumPy foreach row
;NumPy foreach row


<syntaxhighlight lang='python' run>
<syntaxhighlight lang='python' notebook>
import numpy as np
import numpy as np
m = np.matrix([[101,102,103,104],
m = np.matrix([[101,102,103,104],
               [201,202,203,204],
               [201,202,203,204],
               [301,302,303,304]])
               [301,302,303,304]])
m
</syntaxhighlight>
<syntaxhighlight lang='python' notebook>
for i, row in enumerate(m):
for i, row in enumerate(m):
   print(i, row)
   print(i, row)
</syntaxhighlight>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2021년 12월 12일 (일) 16:16 판

1 개요

NumPy foreach row
import numpy as np
m = np.matrix([[101,102,103,104],
               [201,202,203,204],
               [301,302,303,304]])
m
for i, row in enumerate(m):
  print(i, row)

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}