0% found this document useful (0 votes)
12 views

Numpy Practical Coding Questions

The document contains a list of practical coding questions related to NumPy, covering various tasks such as creating arrays, manipulating matrices, and performing mathematical operations. It includes tasks like generating identity matrices, reshaping arrays, and performing element-wise operations. The questions are designed to test and enhance proficiency in using NumPy for numerical computations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Numpy Practical Coding Questions

The document contains a list of practical coding questions related to NumPy, covering various tasks such as creating arrays, manipulating matrices, and performing mathematical operations. It includes tasks like generating identity matrices, reshaping arrays, and performing element-wise operations. The questions are designed to test and enhance proficiency in using NumPy for numerical computations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

NumPy Practical Coding Questions

1. Create a NumPy array containing numbers from 1 to 10.

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.

4. Create an array of shape (4, 4) with values ranging from 1 to 16.

5. Reshape a 1D array `[1,2,3,4,5,6,7,8,9]` into a 3x3 matrix.

6. Extract all even numbers from an array `[3, 6, 9, 12, 15, 18]`.

7. Generate a 5x5 identity matrix using NumPy.

8. Create an array of 10 random numbers between 0 and 1.

9. Find the maximum, minimum, and mean of a given NumPy array.

10. Sort a NumPy array `[34, 12, 45, 9, 1]` in ascending order.

11. Stack two given arrays vertically and horizontally.

12. Create a 3x3 matrix and compute the sum of each row and column.

13. Find the unique elements in an array `[1, 2, 2, 3, 4, 4, 5]`.

14. Multiply two matrices using NumPy.

15. Generate a random 4x4 matrix and replace all values less than 0.5 with 0.

16. Save a NumPy array to a file and load it back.

17. Perform element-wise multiplication of two NumPy arrays.

18. Find the dot product of two vectors.

19. Compute the inverse of a square matrix using NumPy.

20. Create a NumPy structured array with 'name', 'age', and 'height' as fields.

You might also like