<jupyter_start><jupyter_text>1. Import the numpy package<jupyter_code>import numpy as np<jupyter_output><empty_output><jupyter_text>2. Create a 1-dimensional NumPy array with size of 10 filled with value 0<jupyter_code>np.zeros(10, dtype=int)<jupyter_output><empty_output><jupyter_text>3. Create a 1-dimensional NumPy array with size of 10 filled with value 1<jupyter_code>np.ones(10, dtype=int)<jupyter_output><empty_output><jupyter_text>4. Create a 1-dimensional NumPy array with size of 10 filled with value 3.14<jupyter_code>np.full(10, 3.14)<jupyter_output><empty_output><jupyter_text>5. Create a 2-dimensional NumPy array with shape (5,5) filled with value 3.14<jupyter_code>x1 = np.full((5,5), 3.14)
x1<jupyter_output><empty_output><jupyter_text>6. Calculate the total bytes used by the array in 5<jupyter_code>print("Total Bytes: ", x1.nbytes)<jupyter_output>Total Bytes:  200<jupyter_text>7. Create a NumPy array with values in range from 21 to 100<jupyter_code>x = np.arange(21, 101)
x<jupyter_output><empty_output><jupyter_text>8. Reverse the array in 7<jupyter_code>x[::-1]<jupyter_output><empty_output><jupyter_text>9. Create a 10x10 identity matrix<jupyter_code>np.eye(10)<jupyter_output><empty_output><jupyter_text>10. Create a 20x20 NumPy array with random values and find the minimum and maximum values<jupyter_code>x3 = np.random.random(size=(20, 20))
x3
x3.min()
x3.max()<jupyter_output><empty_output><jupyter_text>11. Create a 6x6 NumPy array with random values. Split the array evenly vertically<jupyter_code>np.random.seed(0)
x4 = np.random.randint(10, size=(6,6))
x4

upper, lower = np.vsplit(x4, 2)
print("Upper: ")
print(upper)
print("Lower: ")
print(lower)<jupyter_output>Upper: 
[[5 0 3 3 7 9]
 [3 5 2 4 7 6]
 [8 8 1 6 7 7]]
Lower: 
[[8 1 5 9 8 9]
 [4 3 0 3 5 0]
 [2 3 8 1 3 3]]<jupyter_text>12. For the same arry in 11, split the array evenly horizontally<jupyter_code>left, right = np.hsplit(x4, 2)
print("Left: ")
print (left)
print("Right: ")
print(right)<jupyter_output>Left: 
[[5 0 3]
 [3 5 2]
 [8 8 1]
 [8 1 5]
 [4 3 0]
 [2 3 8]]
Right: 
[[3 7 9]
 [4 7 6]
 [6 7 7]
 [9 8 9]
 [3 5 0]
 [1 3 3]]
{'fraction_non_alphanumeric': 0.13029162746942616, 'fraction_numerical': 0.08137347130761995, 'mean_word_length': 5.8173076923076925, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 46, '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': '12', 'dir': 'jupyter-structured-clean-dedup', 'id': '617599', 'license': 'MIT', 'n_tokens_mistral': 993, 'n_tokens_neox': 867, 'n_words': 242, 'path': 'Data_690_3_Assignment_9.ipynb', 'repo_name': 'tmarissa/DATA-690-3-Kim', 'size': '2126'}