NumPy Arrays Arrays Creation, Ranges, arange(), linspace(), Indexing, Slicing, Reshaping, Transposing, Views vs Copies Creating Arrays from Ranges 1. Create an array from 0 to 10. 2. Create an array from 5 to 15. 3. Create an array from 10 to 50 with step = 5. Creating Arrays with linspace() 1. Create 20 values between 1 and 5. 2. Create 100 values between 0 and 10. Indexing and Slicing Given array: [12, 15, 18, 21, 24, 27, 30] 1. Extract values from 21 to 27. 2. Extract values from index 2 till the end. 3. Extract every 2nd element. Slicing in 2D Arrays Given 2D array: [[1,2,3,4,5,6], [9,8,7,6,5,4]] 1. Print the 3rd element of each row. 2. Slice [first row, elements 1 to 4]. 3. Slice all rows, elements 2 onward. Reshaping and Transposing 1. Reshape array of 12 elements into 3x4. 2. Reshape into 2x6. Transpose the reshaped array. Views vs Copies Create a view and modify it. Create a copy and modify it. Final Integrated Task: 1. Generate a 2D array using arange(). 2. Reshape it into 4 × 5. 3. Print first row, last column, and transpose. Practice Questions 1. Create an array from 0 to 50 with step size 3. 2. Generate 30 evenly spaced values between 10 and 20. 3. Print elements 5 to 15 from arr = np.arange(1,21). 4. Extract every 3rd element from an array of 20 numbers. 5. Extract the first two columns of a 2D array. 6. Print the last two rows of a 2D array. 7. Demonstrate modification on a copied array. 8. Demonstrate modification on a view. 9. Reshape a 1D array of 24 elements into 3 × 8. 10. Generate an array using linspace() and reshape it to 5 × 4.