Numpy Practical Coding Questions
Numpy Practical Coding Questions
2. Create a 3x3 matrix filled with zeros, ones, and random numbers.
3. Given an array `[10, 20, 30, 40, 50]`, replace all values greater than 25 with 0.
6. Extract all even numbers from an array `[3, 6, 9, 12, 15, 18]`.
10. Sort a NumPy array `[34, 12, 45, 9, 1]` in ascending order.
12. Create a 3x3 matrix and compute the sum of each row and column.
15. Generate a random 4x4 matrix and replace all values less than 0.5 with 0.
20. Create a NumPy structured array with 'name', 'age', and 'height' as fields.