質問編集履歴

2

追記編集

2018/07/19 06:23

投稿

yohehe
yohehe

スコア48

test CHANGED
File without changes
test CHANGED
@@ -46,34 +46,34 @@
46
46
 
47
47
  ```python
48
48
 
49
+ num=10 #移動平均の個数
50
+
51
+ b=np.ones(num)/num
49
52
 
50
53
 
51
- e_=e.mean()
52
54
 
53
- e_=e-e_
55
+ e_=np.convolve(e, b, mode='same')#移動平均
54
56
 
55
- e_=np.sqrt(e_*e_)
57
+ f=e-e_
56
58
 
57
- num=20 #移動平均の個数を設定する。
59
+ f=f*f
58
60
 
59
- f=np.ones(num)/num
61
+ f_=np.convolve(f,b,mode="same")
60
62
 
61
- y=np.convolve(e_,f,mode="same")
63
+ plt.plot(e,label="original")
62
64
 
63
- plt.plot(e,color="blue")
65
+ plt.plot(f_,label="ido_heikin")
64
66
 
65
- plt.plot(e_,color="orange",label="sqrt(e_*e_)")
66
-
67
- plt.plot(y,color="red",label="mean")
67
+ plt.grid()
68
68
 
69
69
  plt.legend()
70
70
 
71
71
  plt.show()
72
72
 
73
+ ```
73
74
 
74
75
 
75
- ```
76
76
 
77
- ![イメージ説明](99a4d89d028458171a4fdd84091b586b.png)
77
+ ![イメージ説明](d9fa90e44843374b455a308eb18675da.png)
78
78
 
79
79
  教えていただいたやり方で移動平均のグラフ化まで行なってみました。

1

アドバイスをもとに追記いたしました。

2018/07/19 06:23

投稿

yohehe
yohehe

スコア48

test CHANGED
File without changes
test CHANGED
@@ -35,3 +35,45 @@
35
35
  このデータから振幅が激しい部分を含めたarray raw150を取り出したいとすると
36
36
 
37
37
  np.max(e)で最大値を計算して、その前後を取り出すような方法だといまいちだと思うのですが、何か最適ないい方法がありますでしょうか。
38
+
39
+
40
+
41
+
42
+
43
+ 追記
44
+
45
+
46
+
47
+ ```python
48
+
49
+
50
+
51
+ e_=e.mean()
52
+
53
+ e_=e-e_
54
+
55
+ e_=np.sqrt(e_*e_)
56
+
57
+ num=20 #移動平均の個数を設定する。
58
+
59
+ f=np.ones(num)/num
60
+
61
+ y=np.convolve(e_,f,mode="same")
62
+
63
+ plt.plot(e,color="blue")
64
+
65
+ plt.plot(e_,color="orange",label="sqrt(e_*e_)")
66
+
67
+ plt.plot(y,color="red",label="mean")
68
+
69
+ plt.legend()
70
+
71
+ plt.show()
72
+
73
+
74
+
75
+ ```
76
+
77
+ ![イメージ説明](99a4d89d028458171a4fdd84091b586b.png)
78
+
79
+ 教えていただいたやり方で移動平均のグラフ化まで行なってみました。