Numpy Programming Questions
Numpy Programming Questions
Topics
1. Write a Python program to calculate basic statistical measures like mean, median,
standard deviation, and variance for a given 1D NumPy array.
2. Implement a Python program to sort a NumPy array along different axes. Demonstrate
how to sort a 2D array by columns and by rows.
3. Write a Python program that uses NumPy to search for a specific value in an array and
return its index. Also, demonstrate how to count the occurrences of a specific value in the
array.
4. Write a Python program to demonstrate the difference between a copy and a view in
NumPy. Modify both the original array and the view, and observe the changes in the data.
5. Write a Python program that uses the NumPy matrix library to create and manipulate a
matrix. Perform operations like addition, subtraction, and matrix multiplication.
6. Write a Python program to calculate the dot product of two vectors and the matrix
product of two matrices using NumPy’s linear algebra module.
7. Implement a Python program to solve a system of linear equations using NumPy. Use the
linalg.solve() function to find the solution of the system.
8. Write a Python program that computes the eigenvalues and eigenvectors of a square
matrix using NumPy’s linalg module. Demonstrate the use of these values.
9. Write a Python program that calculates the inverse and determinant of a given matrix
using NumPy’s linalg module. Also, demonstrate how to handle singular matrices.
10. Write a Python program to perform Singular Value Decomposition (SVD) on a matrix
using NumPy. Demonstrate how to reconstruct the matrix using the SVD components.