<jupyter_start><jupyter_text>Practice on Numpy and PandasHere are some task for you, to refresh what you saw in the notebooks before.It will help you strengthen the **learning objectives** from the notebook before. You should be able to- create numpy arrays- manipulate them with basic mathematics operators- extract rows, columns and items by indexing- use aggregation methods (like sum, min, max, std) on numpy arrays**Part 1**: Creating numpy arrays.- Please create a numpy array from the list:```Pythonmy_list = [1, 2, 5, 6, 8]````- Please create a numpy array containing the values from 1 to 10.-  Please create a numpy array from 0 to 5 cwith a stepsize of 0.2- Create a numpy array with the shape 2,3 with random values<jupyter_code>#1
import numpy as np
my_list_1 = np.arange(1,11)
my_list_1
#2
my_list_2 = np.arange(0,5, 0.2)
my_list_2
#3
my_list_3 = np.random.rand(2,3)
my_list_3<jupyter_output><empty_output><jupyter_text>**Part 2**: Manipulate numpy arrays.1. Please create a numpy array with (1, 3, '4', 7, 12, '0'). Define the content as integer.2. Check the data type of the objects and the shape of the array3. Update the 4th value to 30.4. Reshape the array to a 2x3 matrix.5. Please add 8 to the first row and 12 to the second row.6. Mulitply the first column with 2, the second with 3 and the third with 4.7. Please summ up all numbers in the first row, and all numbers in the second row.8. Similarly, search for the largest number for each column.9. Extract the number in the second column and the first row.10. Check at which index the value is exactly 48.<jupyter_code>#1
my_list_4 = np.array([1, 3, '4', 7, 12, '0'], np.int32)
my_list_4
#2
print(type(my_list_4))
print(my_list_4.shape)
#3
my_list_4 = np.where(my_list_4 == 4, 30, my_list_4) 
my_list_4
#4
my_list_4 = np.array(my_list_4).reshape(2, 3)
print(my_list_4)
#5
my_list_4 = my_list_4 + [[8], [12]]
my_list_4
#6
my_list_4 = my_list_4 * [2, 3, 4]
my_list_4
#7
my_list_4 .sum(axis=1)
#8
my_list_4.max(axis=0)
#9
my_list_4[:1, 1]
#10
print(np.where(my_list_4 == 48))<jupyter_output>(array([1]), array([2]))
{'fraction_non_alphanumeric': 0.10508637236084453, 'fraction_numerical': 0.05998080614203455, 'mean_word_length': 4.728021978021978, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '512941', 'license': 'MIT', 'n_tokens_mistral': 805, 'n_tokens_neox': 745, 'n_words': 301, 'path': '08_numpy_practice.ipynb', 'repo_name': 'Jaoaud/Numpy_Pandas', 'size': '2084'}