<jupyter_start><jupyter_text>Initilize the diffferent types of array<jupyter_code>import numpy as np
np.zeros((2,2))
np.ones((2,2), dtype="int32")
np.eye(2)
np.full((2,2), 4,dtype="float32")
a = np.array([3,6,9], dtype="int16")
np.full_like(a,6)
np.random.rand(4,2)
np.random.random_sample(a.shape)
np.random.randint(4,8, size=(3,3))
np.identity(4)
arr = np.array([1,2,3])
r1 = np.repeat(arr,2)
r1
arr = np.array([[1,2,3]])
r2 = np.repeat(arr,2,axis=0)
r2
r3 = np.repeat(arr,2,axis=1)
r3
output = np.ones((5,5))
z = np.zeros((3,3))
z[1,1] = 9
output[1:4,1:4] = z
output<jupyter_output><empty_output><jupyter_text>Be carefull when copying arrays!!!<jupyter_code>a = np.array([1,2,3])
b = a.copy()
b[0] = 100
b
a<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22432432432432434, 'fraction_numerical': 0.08108108108108109, 'mean_word_length': 6.967741935483871, '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': '244973', 'license': 'BSD-4-Clause-UC', 'n_tokens_mistral': 377, 'n_tokens_neox': 366, 'n_words': 57, 'path': 'path_of_ML/Numpy/Untitled2.ipynb', 'repo_name': 'Alferdize/Machine-Learning-in-Python', 'size': '740'}