回答編集履歴

1

2023/03/01 00:16

投稿

melian
melian

スコア19825

test CHANGED
@@ -3,7 +3,7 @@
3
3
  import numpy as np
4
4
 
5
5
  a = np.array([(0, 1), (0, 2), (1, 3), (2, 4), (1, 5), (2, 6)], dtype='i,i')
6
- b = np.array([(i+100, j+100) for i, j in a], dtype=a.dtype)
6
+ b = np.array([tuple(i+100 for i in x) for x in a], dtype=a.dtype)
7
7
 
8
8
  print(f'{a = }')
9
9
  print(f'{b = }')