![見出し画像](https://assets.st-note.com/production/uploads/images/66838564/rectangle_large_type_2_8076f65045de361e11c9b8698ae6bf77.png?width=1200)
[第1回] pythonとjupyter notebook
jupyter notebookとpythonを利用した分析講座となっております。
pythonの起動
・new -> python3からjupyter notebookを起動する
![jupyter notebookでpythonを使用する](https://assets.st-note.com/production/uploads/images/66320348/picture_pc_7d2f8abb5686e3f728b2afc1e1789191.png?width=1200)
計算式の入力
・In[]に入力し、Run で Outに出力結果表示される
![jupyter notebookでの計算式利用イメージ](https://assets.st-note.com/production/uploads/images/66320576/picture_pc_9baa96c313c059f637a6e84de5209fed.png?width=1200)
Numpyで二次元配列を作成する
・Pythonの数値計算ライブラリの「Numpy」を利用してみる
![numpyをインポート](https://assets.st-note.com/production/uploads/images/66320789/picture_pc_8d66fe9c0deaafa16a1634f7dc3ca818.png?width=1200)
import numpy as np
# シード値を設定し同じ処理を実行しても同一結果を得られるようにする?
np.random.seed(1)
# x軸は0〜9までの配列を作成
x = np.arange(10)
# 1〜100までの数字をランダムに10個生成
y = np.random.randint(1, 100, 10)
#出力
print(x)
print(y)
matplotlibを利用してグラフを描画
・matplotlibライブラリを使いグラフを生成してみる
![出力したグラフイメージ](https://assets.st-note.com/production/uploads/images/66320771/picture_pc_68085e173bfa77ed917b782dcaa66194.png?width=1200)
import matplotlib.pyplot as plt
plt.plot(x,y)
plt.show()