<jupyter_start><jupyter_text>1. vector operation(+, -) **python list + : concatenation (근본적으로 벡터 / 행렬 연산과 거리가 먼 자료구조)****ndarray + : entry addition**<jupyter_code>a = [1,2,3,4]
b = [10,20,30,40]

a+b
c = np.array(a)
d = np.array(b)

c+d
c-d<jupyter_output><empty_output><jupyter_text>2. Broadcasting ( vector + scalar ) ```vector의 모든 element에 scalar를 복제해 operation!```<jupyter_code>a = np.array([1,2,3,4])
b = 10

a+b
a-b<jupyter_output><empty_output><jupyter_text>3. Broadcasting ( matrix + vector )```matrix에 vector의 행 또는 열을 그대로 복제해 operation!ex) 3,2 mat / 3,1 vec==> 3,1 vec의 1열을 2열로 복제해 3,2mat + 3,2vec* 를 연산함```<jupyter_code>a = np.random.randint(low=0,high=10,size=(3,2))
b = np.array([[100],[200],[300]])

print(f"a : \n{a}, \nb: \n{b}, \na+b : \n{a+b}")<jupyter_output>a : 
[[0 3]
 [3 6]
 [9 7]], 
b: 
[[100]
 [200]
 [300]], 
a+b : 
[[100 103]
 [203 206]
 [309 307]]
{'fraction_non_alphanumeric': 0.2208237986270023, 'fraction_numerical': 0.09153318077803203, 'mean_word_length': 4.912162162162162, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '416365', 'license': 'MIT', 'n_tokens_mistral': 507, 'n_tokens_neox': 493, 'n_words': 89, 'path': '1.Study/2. with computer/4.Programming/2.Python/9. Numpy/ch2/Chapter2 Arithmetic Operations_Notebook1 ndarray Addition, Subtraction and Broadcasting.ipynb', 'repo_name': 'jskim0406/Study', 'size': '874'}