0% found this document useful (0 votes)
26 views1 page

Numpy Questions

The document contains a list of practice questions on NumPy, covering topics such as array creation, manipulation, and mathematical operations. It includes questions about creating identity matrices, generating random arrays, and performing element-wise operations. Additionally, it addresses handling missing values and computing dot products.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Numpy Questions

The document contains a list of practice questions on NumPy, covering topics such as array creation, manipulation, and mathematical operations. It includes questions about creating identity matrices, generating random arrays, and performing element-wise operations. Additionally, it addresses handling missing values and computing dot products.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Numpy-Questions

December 2024

Practice Questions on NumPy


1. How do you create a NumPy array from a Python list?
2. What is the difference between np.array() and np.asarray()?
3. Demonstrate how to create a 3x3 identity matrix using NumPy.
4. How would you find the shape and size of a NumPy array?

5. Write code to generate a random array of shape (4, 5) with values between
0 and 1.
6. Explain how you would perform element-wise addition and multiplication
on two arrays.

7. What is the difference between np.zeros() and np.ones()?


8. How do you reshape a NumPy array without changing its data?
9. Demonstrate how to find the mean, median, and standard deviation of a
NumPy array.

10. Write code to extract all even numbers from a given NumPy array.
11. How do you stack two NumPy arrays vertically and horizontally?
12. Explain how you would perform slicing and indexing on a 2D NumPy
array.

13. How can you handle missing values in a NumPy array?


14. Write a code snippet to create a boolean mask for values greater than a
threshold in a NumPy array.
15. How do you compute the dot product of two matrices using NumPy?

You might also like