<jupyter_start><jupyter_text>operation in array<jupyter_code>test_array = np.arange(1,11)
test_array
test_array.sum(dtype=np.float)
test_array = np.arange(1,13).reshape(3,4)
test_array.sum()
test_array.sum(axis=1), test_array.sum(axis=0)
third_order_tensor = np.array([test_array,test_array,test_array])
third_order_tensor
third_order_tensor.sum(axis=2)
third_order_tensor.sum(axis=1)
third_order_tensor.sum(axis=0)
test_array = np.arange(1,13).reshape(3,4)
test_array
test_array.mean(), test_array.mean(axis=0)
test_array.std(), test_array.std(axis=0)
np.exp(test_array), np.sqrt(test_array)<jupyter_output><empty_output><jupyter_text>Concatenate<jupyter_code>a = np.array([1, 2, 3])
b = np.array([2, 3, 4])
np.vstack((a,b))
a = np.array([ [1], [2], [3]])
b = np.array([ [2], [3], [4]])
np.hstack((a,b))
a = np.array([[1, 2, 3]])
b = np.array([[2, 3, 4]])
np.concatenate( (a,b) ,axis=0)
a = np.array([[1, 2], [3, 4]])
b = np.array([[5, 6]])

np.concatenate( (a,b.T) ,axis=1)

a.tolist()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2153392330383481, 'fraction_numerical': 0.04523107177974434, 'mean_word_length': 7.775862068965517, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '287392', 'license': 'MIT', 'n_tokens_mistral': 485, 'n_tokens_neox': 476, 'n_words': 68, 'path': 'inflearn_machine_learning/code/ch3/5_ndarray_operation_functions.ipynb', 'repo_name': 'Junhojuno/TIL', 'size': '1017'}