<jupyter_start><jupyter_text>numpyの軽い復習<jupyter_code>import numpy as np
A = np.array([[1, 2],[3, 4]])
print(A)
B = np.array([[3, 0], [0, 6]])
print(B)
A + B
A * B
X = np.array([[51, 55], [14, 19], [0, 4]])
print(X)
X[0] #0行目
X[: ,1] #1列目を一行で
X.flatten() # outplace
X = X.flatten()
X[[0, 2, 4]] #0, 2, 4番目の要素を取得
X[np.array([0, 2, 4])] #0, 2, 4番目の要素を取得
X > 15
(X > 15).dtype
X[X>15]<jupyter_output><empty_output><jupyter_text>matlabの復習<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
x = np.arange(0, 6, 0.1) # 0~6まで0.1刻みで作成
y = np.sin(x)
plt.plot(x, y)
plt.show()
y2 = np.cos(x)
plt.plot(x, y, label="sin")
plt.plot(x, y2, label="cos")
plt.xlabel("x")
plt.ylabel("y")
plt.title('sin & cos')
plt.legend()
plt.show()
from matplotlib.image import imread
img = imread('./lena.png')
plt.imshow(img)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22850412249705537, 'fraction_numerical': 0.05889281507656066, 'mean_word_length': 5.390977443609023, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '211478', 'license': 'MIT', 'n_tokens_mistral': 484, 'n_tokens_neox': 453, 'n_words': 90, 'path': 'other/Introduction.ipynb', 'repo_name': 'tomo-2525/DeepLearning_0', 'size': '849'}