<jupyter_start><jupyter_text>Assignment1. Create an array of shape (10, 10) with uint8 random values.2. print the shape, size and dimension, 3. Compute the sum of the third row to the last.4. Compute the average of the columns<jupyter_code># 1. Create an array of shape (10, 10) with uint8 random values.

import numpy as np

ar10x10 = np.random.randint(0, 256, (10,10), dtype='uint8') 
# ar10x10 = np.random.randint(0, 256, (10,10), dtype=np.uint8) 

# 2. print the shape, size and dimension, 

print('shape=', ar10x10.shape)
print('size=', ar10x10.size)
print('dimension=', ar10x10.ndim)

row_3_from_last = ar10x10[-3]
print(row_3_from_last)
sum_row_3_from_last = np.sum(row_3_from_last)
print(sum_row_3_from_last)
# 3. Compute the sum of the third row to the last.

row_3_to_last = ar10x10[3:]
print(row_3_to_last)


sum_row_3_to_last = np.sum(row_3_to_last)
print('sum=', sum_row_3_to_last)
sum_row_3_to_last_axis_0 = np.sum(row_3_to_last, axis=0)
print(sum_row_3_to_last_axis_0)
sum_row_3_to_last_axis_0.shape
sum_row_3_to_last_axis_1 = np.sum(row_3_to_last, axis=1)
print(sum_row_3_to_last_axis_1)
sum_row_3_to_last_axis_1.shape
# 4. Compute the average of the columns

ar_ave = np.mean(ar10x10, axis=0)
print(ar_ave)<jupyter_output>[124.1 104.7 144.7 140.7 106.7 105.6 119.9 143.6 141.3  82.2]
{'fraction_non_alphanumeric': 0.11461538461538462, 'fraction_numerical': 0.10461538461538461, 'mean_word_length': 5.776041666666667, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '263287', 'license': 'MIT', 'n_tokens_mistral': 637, 'n_tokens_neox': 562, 'n_words': 128, 'path': 'essential/a05.ipynb', 'repo_name': 'azuryne/cv', 'size': '1300'}