Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
19 views

Python Numpy

Contains Python Numpy MCQs with options and answers

Uploaded by

shreya0473
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Python Numpy

Contains Python Numpy MCQs with options and answers

Uploaded by

shreya0473
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Python: Numpy

NumPy, short for Numerical Python, is one of the fundamental packages for numerical
computing in Python. It provides support for large, multi-dimensional arrays and
matrices, along with a collection of mathematical functions to operate on these arrays
efficiently. NumPy forms the foundation for many other scientific computing libraries
in Python, making it an essential tool for data scientists, engineers, and researchers.

Key Features:

1.
Arrays: NumPy's primary object is the homogeneous multidimensional array. These
arrays are collections of elements of the same data type and are indexed by a tuple of
nonnegative integers. NumPy's array class is called numpy.ndarray.
2.
3.
Vectorized Operations: NumPy provides a broad range of mathematical functions
that operate element-wise on arrays, making it efficient for numerical computations.
These operations are optimized and implemented in C, leading to faster execution
compared to equivalent operations in pure Python.
4.
5.
Broadcasting: NumPy allows operations between arrays of different shapes and
sizes. When performing arithmetic operations between arrays, NumPy automatically
broadcasts the smaller array to match the shape of the larger array, enabling efficient
computation without unnecessary copying of data.
6.
7.
Linear Algebra: NumPy includes a rich set of functions for linear algebra operations
such as matrix multiplication, decomposition, eigenvalues, and solving linear
equations. These functions are implemented using highly optimized BLAS and LAPACK
libraries.
8.
9.
Random Number Generation: NumPy provides facilities to generate random
numbers using various probability distributions. These functions are useful for tasks
such as simulating random processes, generating random samples for statistical
analysis, and initializing arrays with random values.
10.
11.
Integration with Other Libraries: NumPy seamlessly integrates with other Python
libraries such as SciPy (scientific computing), Matplotlib (plotting), Pandas (data
analysis), and scikit-learn (machine learning), forming a powerful ecosystem for
scientific computing and data analysis in Python.
12.

Basic Usage:

1.
Array Creation:
2.
3.
python
4.
5.
Copy code
6.
7.
import numpy as np
# Creating an array from a list
arr1 = np.array([1, 2, 3, 4, 5])
# Creating a multi-dimensional array
arr2 = np.array([[1, 2, 3], [4, 5, 6]])
# Creating arrays with specific values
zeros = np.zeros((3, 3)) # Creates a 3x3 array of zeros
ones = np.ones((2, 2)) # Creates a 2x2 array of ones
random_array = np.random.rand(3, 3) # Creates a 3x3 array of random values
8.
9.
10.
Array Operations:
11.
12.
python
13.
14.
Copy code
15.
16.
# Element-wise arithmetic operations
result = arr1 + arr2
result = arr1 * 2
# Matrix multiplication
matrix_product = np.dot(arr1, arr2)
# Statistical operations
mean = np.mean(arr1)
std_dev = np.std(arr2)
# Reshaping arrays
reshaped_array = arr1.reshape(2, 2)
17.
18.
19.
Indexing and Slicing:
20.
21.
python
22.
23.
Copy code
24.
25.
# Accessing elementsprint(arr1[0]) # Access first elementprint(arr2[1,
1]) # Access element at row 1, column 1
# Slicing
sliced_array = arr1[1:4] # Extract elements from index 1 to 3
26.
27.
Conclusion:

NumPy is a cornerstone of scientific computing in Python, providing a powerful array


processing capability along with a wide range of mathematical functions. Its efficiency,
flexibility, and integration with other libraries make it indispensable for data
manipulation, statistical analysis, simulation, optimization, and much more. Whether
you're a beginner or an expert, mastering NumPy is essential for anyone working with
numerical data in Python.

MCQs

1. What does NumPy stand for?


- A) Numerical Python
- B) Numeric Processing
- C) Numerical Processing
- D) Numeric Python
- **Answer: A) Numerical Python**

2. Which of the following is the primary object in NumPy for storing data?
- A) List
- B) Tuple
- C) ndarray
- D) DataFrame
- **Answer: C) ndarray**

3. What does `np.array([1, 2, 3])` create?


- A) A list
- B) A tuple
- C) A NumPy array
- D) A dictionary
- **Answer: C) A NumPy array**

4. Which of the following is a key feature of NumPy?


- A) Broadcasting
- B) Object-Oriented Programming
- C) Regular Expressions
- D) Web Scraping
- **Answer: A) Broadcasting**

5. Which module should be imported to use NumPy?


- A) numpy
- B) math
- C) scipy
- D) pandas
- **Answer: A) numpy**

6. What does broadcasting in NumPy allow?


- A) Efficient array operations
- B) Broadcasting TV channels
- C) Live streaming
- D) None of the above
- **Answer: A) Efficient array operations**

7. Which library in Python is built on top of NumPy?


- A) Matplotlib
- B) Pandas
- C) Scikit-learn
- D) All of the above
- **Answer: D) All of the above**

8. Which function is used to generate an array of zeros in NumPy?


- A) np.zeros()
- B) np.ones()
- C) np.random.rand()
- D) np.arange()
- **Answer: A) np.zeros()**

9. What does `np.random.rand(2, 2)` generate?


- A) An array of zeros
- B) An array of ones
- C) A random array of shape (2, 2)
- D) A random number
- **Answer: C) A random array of shape (2, 2)**

10. Which of the following is true about NumPy arrays?


- A) They can only contain elements of the same data type
- B) They can contain elements of different data types
- C) They cannot perform arithmetic operations
- D) They are similar to Python lists
- **Answer: A) They can only contain elements of the same data type**

11. What does `np.mean()` compute?


- A) Median
- B) Mode
- C) Mean
- D) Standard deviation
- **Answer: C) Mean**

12. Which function is used to perform matrix multiplication in NumPy?


- A) np.add()
- B) np.dot()
- C) np.multiply()
- D) np.divide()
- **Answer: B) np.dot()**

13. Which of the following is NOT a valid way to create a NumPy array?
- A) np.array([1, 2, 3])
- B) np.matrix([1, 2, 3])
- C) np.zeros((2, 2))
- D) np.arange(10)
- **Answer: B) np.matrix([1, 2, 3])**

14. What is the result of `np.arange(5)`?


- A) [0, 1, 2, 3, 4]
- B) [1, 2, 3, 4, 5]
- C) [0, 1, 2, 3]
- D) [1, 2, 3, 4]
- **Answer: A) [0, 1, 2, 3, 4]**

15. Which function is used to compute the standard deviation in NumPy?


- A) np.mean()
- B) np.median()
- C) np.std()
- D) np.var()
- **Answer: C) np.std()**

16. What is the output of `np.linspace(0, 1, 5)`?


- A) [0, 0.25, 0.5, 0.75, 1]
- B) [0, 0.2, 0.4, 0.6, 0.8, 1]
- C) [0, 0.5, 1]
- D) [0, 1, 5]
- **Answer: A) [0, 0.25, 0.5, 0.75, 1]**

17. Which function is used to find the maximum value in a NumPy array?
- A) np.max()
- B) np.maximum()
- C) np.argmax()
- D) np.amax()
- **Answer: A) np.max()**

18. What is the result of `np.eye(3)`?


- A) Identity matrix of shape (3, 3)
- B) Array of zeros
- C) Array of ones
- D) Random array
- **Answer: A) Identity matrix of shape (3, 3)**

19. Which function is used to perform element-wise multiplication in NumPy?


- A) np.multiply()
- B) np.dot()
- C) np.divide()
- D) np.subtract()
- **Answer: A) np.multiply()**

20. What does `np.random.randint(1, 10, size=(2, 2))` generate?


- A) A random integer between 1 and 10
- B) A random integer between 1 and 9
- C) A random array of size (2, 2)
- D) A random float between 1 and 10
- **Answer: B) A random integer between 1 and 9**

21. Which of the following is NOT a valid data type in NumPy?


- A) int32
- B) float64
- C) string
- D) complex128
- **Answer: C) string**

22. What is the result of `np.array([1, 2, 3]) + np.array([4, 5, 6])`?


- A) [1, 2, 3, 4, 5, 6]
- B) [5, 7, 9]
- C) [4, 5, 6, 7, 8, 9]
- D) Error
- **Answer: B) [5, 7, 9]**

23. Which of the

following functions is used to find the index of the maximum value in a NumPy array?
- A) np.argmax()
- B) np.max_index()
- C) np.maximum_index()
- D) np.argmax_value()
- **Answer: A) np.argmax()**

24. What is the output of `np.array([1, 2, 3]) * 2`?


- A) [1, 2, 3]
- B) [2, 4, 6]
- C) [1, 4, 9]
- D) [1, 2, 3, 1, 2, 3]
- **Answer: B) [2, 4, 6]**

25. Which of the following functions is used to compute the natural logarithm in NumPy?
- A) np.log()
- B) np.exp()
- C) np.sin()
- D) np.cos()
- **Answer: A) np.log()**

26. What is the result of `np.array([1, 2, 3]) @ np.array([4, 5, 6])`?


- A) 32
- B) [4, 10, 18]
- C) [4, 5, 6, 4, 5, 6, 4, 5, 6]
- D) Error
- **Answer: A) 32**

27. Which function is used to compute the element-wise exponential of a NumPy array?
- A) np.exp()
- B) np.log()
- C) np.sqrt()
- D) np.sin()
- **Answer: A) np.exp()**

28. What is the output of `np.arange(10).reshape(2, 5)`?


- A) [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]
- B) [[0, 2, 4, 6, 8], [1, 3, 5, 7, 9]]
- C) [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]
- D) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- **Answer: A) [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]**

29. Which function is used to compute the dot product of two arrays in NumPy?
- A) np.dot()
- B) np.multiply()
- C) np.divide()
- D) np.add()
- **Answer: A) np.dot()**

30. What is the output of `np.arange(1, 10, 2)`?


- A) [1, 2, 3, 4, 5, 6, 7, 8, 9]
- B) [1, 3, 5, 7, 9]
- C) [2, 4, 6, 8, 10]
- D) [1, 3, 5, 7]
- **Answer: B) [1, 3, 5, 7, 9]**

31. Which function is used to compute the element-wise square root of a NumPy array?
- A) np.sqrt()
- B) np.square()
- C) np.exp()
- D) np.log()
- **Answer: A) np.sqrt()**

32. What is the result of `np.arange(5) + 1`?


- A) [1, 2, 3, 4, 5]
- B) [0, 1, 2, 3, 4]
- C) [1, 3, 5, 7, 9]
- D) [2, 3, 4, 5, 6]
- **Answer: D) [2, 3, 4, 5, 6]**

33. Which of the following is true about NumPy broadcasting?


- A) It allows operations between arrays of different shapes and sizes
- B) It is used for broadcasting TV channels
- C) It is similar to matrix multiplication
- D) It only works with arrays of the same shape
- **Answer: A) It allows operations between arrays of different shapes and sizes**

34. What is the output of `np.full((3, 3), 5)`?


- A) Array of zeros
- B) Array of ones
- C) Array of fives
- D) Identity matrix
- **Answer: C) Array of fives**

35. Which function is used to compute the cumulative sum of elements in a NumPy array?
- A) np.sum()
- B) np.cumsum()
- C) np.mean()
- D) np.median()
- **Answer: B) np.cumsum()**

36. What is the result of `np.arange(5) * np.arange(5)`?


- A) [0, 1, 4, 9, 16]
- B) [0, 1, 2, 3, 4]
- C) [0, 1, 2, 3, 4, 0, 1, 2, 3, 4]
- D) Error
- **Answer: A) [0, 1, 4, 9, 16]**

37. Which of the following functions is used to compute the cumulative product of elements in a
NumPy array?
- A) np.prod()
- B) np.cumprod()
- C) np.mean()
- D) np.median()
- **Answer: B) np.cumprod()**

38. What is the output of `np.ones((2, 2)) * 5`?


- A) [[1, 1], [1, 1]]
- B) [[5, 5], [5, 5]]
- C) [[0, 1], [0, 1]]
- D) [[0, 0], [0, 0]]
- **Answer: B) [[5, 5], [5, 5]]**

39. Which of the following is NOT a valid way to access elements in a NumPy array?
- A) Using indexing
- B) Using slicing
- C) Using loops
- D) Using fancy indexing
- **Answer: C) Using loops**

40. What is the output of `np.random.randn(3, 3)`?


- A) Array of zeros
- B) Array of ones
- C) Random array with standard normal distribution
- D)

Random array with uniform distribution


- **Answer: C) Random array with standard normal distribution**

41. Which function is used to compute the element-wise sine of a NumPy array?
- A) np.sin()
- B) np.cos()
- C) np.tan()
- D) np.arcsin()
- **Answer: A) np.sin()**

42. What is the result of `np.concatenate([np.array([1, 2]), np.array([3, 4])])`?


- A) [1, 2, 3, 4]
- B) [[1, 2], [3, 4]]
- C) [1, 2, [3, 4]]
- D) Error
- **Answer: A) [1, 2, 3, 4]**

43. Which of the following functions is used to compute the element-wise cosine of a NumPy array?
- A) np.sin()
- B) np.cos()
- C) np.tan()
- D) np.arccos()
- **Answer: B) np.cos()**

44. What does `np.random.seed(0)` do?


- A) Generates a random seed
- B) Sets the seed for NumPy's random number generator
- C) Resets the random number generator
- D) None of the above
- **Answer: B) Sets the seed for NumPy's random number generator**

45. Which function is used to compute the element-wise tangent of a NumPy array?
- A) np.sin()
- B) np.cos()
- C) np.tan()
- D) np.arctan()
- **Answer: C) np.tan()**

46. What is the output of `np.array([1, 2, 3])[:, np.newaxis]`?


- A) [1, 2, 3]
- B) [[1], [2], [3]]
- C) [[1, 2, 3]]
- D) Error
- **Answer: B) [[1], [2], [3]]**

47. Which function is used to compute the element-wise arcsine of a NumPy array?
- A) np.sin()
- B) np.arcsin()
- C) np.cos()
- D) np.arccos()
- **Answer: B) np.arcsin()**

48. What is the output of `np.arange(10).reshape(2, -1)`?


- A) [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]
- B) [[0, 2, 4, 6, 8], [1, 3, 5, 7, 9]]
- C) [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]
- D) Error
- **Answer: A) [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]**

49. Which function is used to compute the element-wise arctangent of a NumPy array?
- A) np.tan()
- B) np.arctan()
- C) np.sin()
- D) np.cos()
- **Answer: B) np.arctan()**

50. What is the output of `np.array([1, 2, 3]) @ np.array([1, 2, 3])`?


- A) [1, 2, 3]
- B) 14
- C) [14]
- D) Error
- **Answer: B) 14**

51. Which function is used to compute the element-wise hyperbolic sine of a NumPy array?
- A) np.sinh()
- B) np.cosh()
- C) np.tanh()
- D) np.arcsinh()
- **Answer: A) np.sinh()**

52. What is the output of `np.array([1, 2, 3]) * np.array([1, 2, 3])`?


- A) [1, 2, 3]
- B) [1, 4, 9]
- C) [2, 4, 6]
- D) Error
- **Answer: B) [1, 4, 9]**

53. Which function is used to compute the element-wise hyperbolic cosine of a NumPy array?
- A) np.sinh()
- B) np.cosh()
- C) np.tanh()
- D) np.arccosh()
- **Answer: B) np.cosh()**

54. What is the output of `np.mean(np.array([1, 2, 3]))`?


- A) 1
- B) 2
- C) 3
- D) 2.0
- **Answer: D) 2.0**

55. Which function is used to compute the element-wise hyperbolic tangent of a NumPy array?
- A) np.sinh()
- B) np.cosh()
- C) np.tanh()
- D) np.arctanh()
- **Answer: C) np.tanh()**

56. What is the output of `np.std(np.array([1, 2, 3]))`?


- A) 0
- B) 1
- C) 2
- D) 0.816496580927726
- **Answer: D) 0.816496580927726**

57. Which function is used to compute the element-wise floor division of two NumPy arrays?
- A) np.divide()
- B) np.floor_divide()
- C) np.mod()
- D) np.power()
- **Answer: B) np.floor_divide()**

58. What is the output of `np.var(np.array([1, 2, 3]))`?


- A) 0
- B) 1
- C) 2
- D) 0.6666666666666666
- **Answer: D) 0.6666666666666666**

59. Which function is used to compute the element-wise remainder of division in NumPy?
- A) np.divide()
- B) np.floor_divide()
- C) np.mod()
- D) np.power()
- **Answer: C) np.mod()**

60. What is the output of `np.log(np.exp(2))`?


- A) 2
- B) e
- C) 1
- D) Error
- **Answer: A) 2**

61. Which function is used to compute the element-wise exponentiation of two Num

Py arrays?
- A) np.power()
- B) np.sqrt()
- C) np.log()
- D) np.exp()
- **Answer: A) np.power()**

62. What is the output of `np.pi`?


- A) 3.141592653589793
- B) 3
- C) 3.14
- D) Error
- **Answer: A) 3.141592653589793**

63. Which function is used to compute the element-wise square root of a NumPy array?
- A) np.sqrt()
- B) np.square()
- C) np.exp()
- D) np.log()
- **Answer: A) np.sqrt()**

64. What is the output of `np.sin(np.pi / 2)`?


- A) 0
- B) 1
- C) 0.5
- D) -1
- **Answer: B) 1**

65. Which function is used to compute the element-wise exponential of a NumPy array?
- A) np.exp()
- B) np.log()
- C) np.sqrt()
- D) np.sin()
- **Answer: A) np.exp()**

66. What is the output of `np.floor(2.7)`?


- A) 2
- B) 3
- C) 2.0
- D) 3.0
- **Answer: A) 2**

67. Which function is used to compute the element-wise ceiling of a NumPy array?
- A) np.ceil()
- B) np.floor()
- C) np.round()
- D) np.trunc()
- **Answer: A) np.ceil()**

68. What is the output of `np.ceil(2.3)`?


- A) 2
- B) 3
- C) 2.0
- D) 3.0
- **Answer: B) 3**

69. Which function is used to compute the element-wise absolute value of a NumPy array?
- A) np.abs()
- B) np.absolute()
- C) np.sign()
- D) np.ceil()
- **Answer: A) np.abs()**

70. What is the output of `np.absolute(-5)`?


- A) -5
- B) 5
- C) -1
- D) 1
- **Answer: B) 5**

71. Which function is used to compute the element-wise sign of a NumPy array?
- A) np.abs()
- B) np.absolute()
- C) np.sign()
- D) np.ceil()
- **Answer: C) np.sign()**

72. What is the output of `np.sign(-3)`?


- A) -3
- B) 3
- C) -1
- D) 1
- **Answer: C) -1**

73. Which function is used to compute the element-wise logarithm of a NumPy array?
- A) np.log()
- B) np.exp()
- C) np.sqrt()
- D) np.sin()
- **Answer: A) np.log()**

74. What is the output of `np.log(np.exp(3))`?


- A) 3
- B) e
- C) 1
- D) Error
- **Answer: A) 3**

75. Which function is used to compute the element-wise square of a NumPy array?
- A) np.square()
- B) np.sqrt()
- C) np.log()
- D) np.exp()
- **Answer: A) np.square()**

76. What is the output of `np.square(4)`?


- A) 2
- B) 4
- C) 8
- D) 16
- **Answer: D) 16**

77. Which function is used to compute the element-wise cube root of a NumPy array?
- A) np.sqrt()
- B) np.cbrt()
- C) np.log()
- D) np.exp()
- **Answer: B) np.cbrt()**

78. What is the output of `np.cbrt(8)`?


- A) 2
- B) 4
- C) 8
- D) Error
- **Answer: A) 2**

79. Which function is used to compute the element-wise floor of a NumPy array?
- A) np.floor()
- B) np.ceil()
- C) np.round()
- D) np.trunc()
- **Answer: A) np.floor()**

80. What is the output of `np.floor(3.9)`?


- A) 3
- B) 4
- C) 3.0
- D) 4.0
- **Answer: A) 3**

81. Which function is used to compute the element-wise round of a NumPy array?
- A) np.round()
- B) np.floor()
- C) np.ceil()
- D) np.trunc()
- **Answer: A) np.round()**

82. What is the output of `np.round(3.4)`?


- A) 3
- B) 4
- C) 3.0
- D) 4.0
- **Answer: A) 3**

83. Which function is used to compute the element-wise maximum of two NumPy arrays?
- A) np.max()
- B) np.maximum()
- C) np.min()
- D) np.minimum()
- **Answer: B) np.maximum()**

84. What is the output of `np.maximum([2, 3, 4], [1, 5, 2])`?


- A) [2, 3, 4]
- B) [1, 3, 2]
- C) [2, 5, 4]
- D) [1, 5, 2]
- **Answer: C) [2, 5, 4]**

85. Which function is used to compute the element-wise minimum of two NumPy arrays?
- A) np.max()
- B) np.maximum()
- C) np.min()
- D) np.minimum()
- **Answer: D) np.minimum()**

86. What is the output of `np.minimum([2, 3, 4], [1, 5, 2])`?


- A) [2, 3, 4]
- B) [1, 3, 2]
- C) [2, 5, 4]
- D) [1, 5, 2]
- **Answer

: D) [1, 3, 2]**

87. Which function is used to compute the element-wise absolute difference between two NumPy
arrays?
- A) np.absdiff()
- B) np.absolute_diff()
- C) np.abs_diff()
- D) np.diff_abs()
- **Answer: A) np.absdiff()**

88. What is the output of `np.absdiff([1, 3, 5], [2, 4, 6])`?


- A) [1, 3, 5]
- B) [1, 2, 3]
- C) [1, 1, 1]
- D) [2, 1, 1]
- **Answer: C) [1, 1, 1]**

89. Which function is used to compute the element-wise reciprocal of a NumPy array?
- A) np.reciprocal()
- B) np.inverse()
- C) np.inv()
- D) np.flip()
- **Answer: A) np.reciprocal()**

90. What is the output of `np.reciprocal([1, 2, 4])`?


- A) [1, 2, 4]
- B) [1, 0.5, 0.25]
- C) [1, 1, 1]
- D) [1, 0, 0]
- **Answer: B) [1, 0.5, 0.25]**

91. Which function is used to compute the element-wise square of a NumPy array?
- A) np.square()
- B) np.sqrt()
- C) np.log()
- D) np.exp()
- **Answer: A) np.square()**

92. What is the output of `np.square([2, 3, 4])`?


- A) [2, 3, 4]
- B) [4, 9, 16]
- C) [2, 6, 8]
- D) [4, 3, 4]
- **Answer: B) [4, 9, 16]**

93. Which function is used to compute the element-wise cube of a NumPy array?
- A) np.cube()
- B) np.power()
- C) np.sqrt()
- D) np.log()
- **Answer: B) np.power()**

94. What is the output of `np.power([2, 3, 4], 3)`?


- A) [2, 3, 4]
- B) [8, 27, 64]
- C) [2, 6, 12]
- D) [8, 3, 4]
- **Answer: B) [8, 27, 64]**

95. Which function is used to compute the element-wise cube root of a NumPy array?
- A) np.cbrt()
- B) np.power()
- C) np.sqrt()
- D) np.log()
- **Answer: A) np.cbrt()**

96. What is the output of `np.cbrt([8, 27, 64])`?


- A) [2, 3, 4]
- B) [8, 27, 64]
- C) [2, 6, 12]
- D) [2, 3, 4]
- **Answer: A) [2, 3, 4]**

97. Which function is used to compute the element-wise absolute difference between two NumPy
arrays?
- A) np.absdiff()
- B) np.absolute_diff()
- C) np.abs_diff()
- D) np.diff_abs()
- **Answer: A) np.absdiff()**

98. What is the output of `np.absdiff([1, 3, 5], [2, 4, 6])`?


- A) [1, 3, 5]
- B) [1, 2, 3]
- C) [1, 1, 1]
- D) [2, 1, 1]
- **Answer: C) [1, 1, 1]**

99. Which function is used to compute the element-wise reciprocal of a NumPy array?
- A) np.reciprocal()
- B) np.inverse()
- C) np.inv()
- D) np.flip()
- **Answer: A) np.reciprocal()**

100. What is the output of `np.reciprocal([1, 2, 4])`?


- A) [1, 2, 4]
- B) [1, 0.5, 0.25]
- C) [1, 1, 1]
- D) [1, 0, 0]
- **Answer: B) [1, 0.5, 0.25]**

You might also like