teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

該当コードの記載漏れ(numpy.copy)

2017/12/06 18:20

投稿

mori_takeshi
mori_takeshi

スコア10

title CHANGED
File without changes
body CHANGED
@@ -24,8 +24,14 @@
24
24
  x = np.random.randint(0, 10, size=(3,2))
25
25
  y = np.random.randint(0, 10, size=(3,2))
26
26
  list1 = [x,y]
27
- pool = list1[0][1]
27
+ pool = list1[0][1].copy #修正箇所
28
- pool2 = list1[0][0]
28
+ pool2 = list1[0][0].copy #修正箇所
29
29
  list1[0][0] = pool
30
30
  list1[0][1] = pool2
31
- ```
31
+ ```
32
+
33
+ ###修正箇所
34
+ ご指摘ありがとうございます。
35
+ .copyを記載し忘れておりました。
36
+ 該当コード5,6行目が上のようになります。
37
+ よろしくお願いいたします。