回答編集履歴

2

d

2019/02/25 03:46

投稿

tiitoi
tiitoi

スコア21960

answer CHANGED
@@ -13,5 +13,5 @@
13
13
  ```
14
14
 
15
15
  1. np.square() で自乗を計算
16
- 2. ndarray.mean(axis=1) で列ごとの平均を計算
16
+ 2. ndarray.mean(axis=0) で列ごとの平均を計算
17
17
  3. np.sqrt() で平方根を計算

1

d

2019/02/25 03:46

投稿

tiitoi
tiitoi

スコア21960

answer CHANGED
@@ -7,10 +7,11 @@
7
7
 
8
8
  a = np.random.randn(4000, 252) # テスト用のダミー
9
9
 
10
- rms = np.sqrt(np.square(a).mean())
10
+ rms = np.sqrt(np.square(a).mean(axis=0))
11
- print(rms) # 1.000028685483807
11
+ print(rms.shape) # (252,)
12
+ print(rms)
12
13
  ```
13
14
 
14
15
  1. np.square() で自乗を計算
15
- 2. ndarray.mean() で平均を計算
16
+ 2. ndarray.mean(axis=1) で列ごとの平均を計算
16
17
  3. np.sqrt() で平方根を計算