質問編集履歴
2
初心者アイコンを付けました
title
CHANGED
|
File without changes
|
body
CHANGED
|
File without changes
|
1
コードに誤りがあったので修正しました
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
###前提・実現したいこと
|
|
2
|
-
python3.5を使い、NumPyとmatplotlibをimportして、コマンドプロンプトでステップ関数、シグモイド関数のグラフを書きたいです。
|
|
2
|
+
python3.5を使い、NumPyとmatplotlibをimportして、Atomとコマンドプロンプトでステップ関数、シグモイド関数のグラフを書きたいです。
|
|
3
3
|
初心者です。
|
|
4
4
|
###発生している問題・エラーメッセージ
|
|
5
5
|
Atomで打ち込むとNumPyとmatplotlibが使えない。……①
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
ImportError: No module named 'matplotlib'
|
|
11
11
|
|
|
12
12
|
②コマンドプロンプトに直接打ち込んだ時
|
|
13
|
+
|
|
13
|
-
File "<stdin>", line 2
|
|
14
|
+
File "<stdin>", line 2
|
|
14
|
-
|
|
15
|
+
return np.array(x>0,dtype=np.int)
|
|
15
|
-
|
|
16
|
+
^
|
|
16
17
|
IndentationError: expected an indented block
|
|
17
18
|
|
|
18
19
|
```
|
|
@@ -48,7 +49,8 @@
|
|
|
48
49
|
>>> import numpy as np
|
|
49
50
|
>>> import matplotlib.pylab as plt
|
|
50
51
|
>>> def step_function(x):
|
|
51
|
-
...
|
|
52
|
+
... return np.array(x>0,dtype=np.int)
|
|
53
|
+
|
|
52
54
|
この時点でエラーでした
|
|
53
55
|
```
|
|
54
56
|
|