NumPy MCQ Test: NumPy MCQs - Practice Questions
1. How do you access the element at the 3rd index of a NumPy array named `my_array`?
2. What is the purpose of the `np.save` and `np.load` functions in NumPy?
3. What is the purpose of the `np.ma.masked_array` function in NumPy?
4. How can you find the index of the maximum value in a NumPy array?
5. What is NumPy and what is its primary purpose in Python?
6. Explain the concept of NumPy broadcasting and provide an example.
7. How can you calculate the mean of a NumPy array along a specific axis?
8. In NumPy, what does the 'np.concatenate()' function do?
9. How do you perform matrix multiplication in NumPy?
10. What is the purpose of the NumPy function 'np.ma.masked_where()'?
11. Examine the purpose of the `np.histogram` function in NumPy.
12. What is the purpose of the NumPy function 'np.meshgrid()'?
13. How can you create a diagonal matrix from a NumPy array?
14. What is the purpose of the `np.max` function in NumPy?
15. What is the purpose of the `np.fft.fft` function in NumPy?
16. What is the difference between `np.concatenate` and `np.stack` in NumPy?
17. What is the purpose of the `np.ma.masked_where` function in NumPy?
18. What does the `np.ravel` function do in NumPy?
19. How can you perform element-wise comparison between two NumPy arrays `arr1` and `arr2`?
20. How can you calculate the dot product of two NumPy arrays?
21. How can you create a NumPy array from a Python list?
22. How can you find the sum of all elements in a NumPy array?
23. What is the purpose of the `np.zeros` function in NumPy?
24. Examine the role of universal functions (ufuncs) in NumPy and provide an example.
25. What is the purpose of the NumPy function 'np.fft.fft()'?
26. What does the NumPy function 'np.unique()' return?
27. Examine the purpose of the `np.savez` function in NumPy.
28. How can you calculate the standard deviation of a NumPy array?
29. How can you perform element-wise exponentiation in NumPy?
30. How do you find the unique elements in a NumPy array?
31. What does the NumPy function 'np.percentile()' calculate?
32. What is the purpose of the `np.concatenate` function in NumPy?
33. What is the purpose of the `np.eye` function in NumPy?
34. How do you apply a function element-wise to a NumPy array?
35. How can you flatten a NumPy array?
36. How do you calculate the cumulative sum of elements along a specified axis in a NumPy array?
37. How do you perform element-wise multiplication of two NumPy arrays `arr1` and `arr2`?
38. In NumPy, what does the 'np.pad()' function do?
39. What is the purpose of the NumPy function 'np.histogram()'?
40. What is the purpose of the NumPy function 'np.argsort()'?
41. What does the `np.eye` function do in NumPy?
42. What is the purpose of the `np.random.seed` function in NumPy?
43. What does the NumPy function 'np.unravel_index()' do?
44. What is NumPy used for in Python?
45. What is the role of the `np.mean` function in NumPy?
46. How can you transpose a NumPy array?
47. Explain the difference between a Python list and a NumPy array.
48. How can you perform matrix multiplication in NumPy?
49. What does the `np.clip` function do in NumPy?
50. How do you calculate the element-wise square root of a NumPy array?