<jupyter_start><jupyter_text>NumPy Fundamentals  1. Run the following cells:<jupyter_code>import numpy as np
array_1D = np.array([10,11,12,13, 14])
array_1D
array_2D = np.array([[20,30,40,50,60], [43,54,65,76,87], [11,22,33,44,55]])
array_2D
array_3D = np.array([[[1,2,3,4,5], [11,21,31,41,51]], [[11,12,13,14,15], [51,52,53,54,5]]])
array_3D<jupyter_output><empty_output><jupyter_text>2. Display the first element (not necessarily individual element) for each of the 3 arrays we defined above.  3. Call the first individual element of the each of the 3 arrays.   4. Uses negative indices to display the last element of each array.  5. Set the penultimate (second-to-last)  individual  element of each array equal to 10. Then display the variables to check your work. (Hint: If it's the penultimate individual element of the 2-D/3-D array, it needs to be in the last row of the 2-D array)  6. Set the last column of the 2-D array to 100. Then display the variables to check your work.   7. Set all the values of the 3-D array to 1000. Then display the variables to check your work.   8. Run the next 3 cells to re-define the 3 arrays, since we altered their contents.<jupyter_code>array_1D = np.array([10,11,12,13,14])
array_1D
array_2D = np.array([[20,30,40,50,60], [43,54,65,76,87], [11,22,33,44,55]])
array_2D
array_3D = np.array([[[1,2,3,4,5], [11,21,31,41,51]], [[11,12,13,14,15], [51,52,53,54,5]]])
array_3D<jupyter_output><empty_output><jupyter_text>9. Add 2 to every element of the 3 arrays without overwriting their values.  10. Multiply the values of each array by 100 without overwriting their values.  11. Add up array_1D and the first row of array_2D  12. Find the product of array_1D and the first row of array_2D  13. Find the product  of the first row of array_2D and the first row of the first array of  array_3D   14. Subtract  array_1D  from the first row of array_2D  15. Subtract the first row of array_2D from   array_1D    16. Alter the code in the next 3 cells to re-define the 3 arrays as the following datatypes:    A) array_1D -> NumPy Strings    B) array_2D -> Complex Numbers    C) array_3D -> 64-bit Floats       (Hint: The datatypes are the following: np.str, np.complex, np.float64)<jupyter_code>array_1D = np.array([10,11,12,13,14])
array_1D
array_2D = np.array([[20,30,40,50,60], [43,54,65,76,87], [11,22,33,44,55]])
array_2D
array_3D = np.array([[[1,2,3,4,5], [11,21,31,41,51]], [[11,12,13,14,15], [51,52,53,54,5]]])
array_3D<jupyter_output><empty_output><jupyter_text>17. Now run the next 3 cells to re-define the 3 arrays as 32-bit floats, since we want to run some more computations on them<jupyter_code>array_1D = np.array([10,11,12,13,14], dtype = np.float32)
array_1D
array_2D = np.array([[20,30,40,50,60], [43,54,65,76,87], [11,22,33,44,55]], dtype = np.float32)
array_2D
array_3D = np.array([[[1,2,3,4,5], [11,21,31,41,51]], [[11,12,13,14,15], [51,52,53,54,5]]], dtype = np.float32)
array_3D<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13765182186234817, 'fraction_numerical': 0.13394062078272603, 'mean_word_length': 5.13871635610766, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 20, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '461819', 'license': 'MIT', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1144, 'n_words': 359, 'path': '365 DS/3_6_numpy-fundamentals-exercise.ipynb', 'repo_name': 'alekhaya99/Numpy_Tutorial', 'size': '2964'}