- Home
- Subjects
- Data Science
- NumPy
NumPy MCQs · Page 3
83 multiple choice questions with answers in Data Science.
-
A
Clips values outside a specified range to the range's boundaries
Correct answer
-
B
Rounds the elements of an array to the nearest integer
-
C
Calculates the cumulative sum of elements along a specified axis
-
D
Computes the natural logarithm of the elements of an array
-
A
np.dot()
Correct answer
-
B
np.cross()
-
C
np.inner()
-
D
np.outer()
-
A
Seeds the random number generator for reproducibility
Correct answer
-
B
Generates a random seed value
-
C
Sets the state of the random number generator
-
D
Resets the random number generator
-
A
Flattens a multi-dimensional array into a 1D array
Correct answer
-
B
Transposes a multi-dimensional array
-
C
Reshapes a multi-dimensional array
-
D
Concatenates two arrays along a specified axis
import numpy as np
arr = np.arange(9).reshape(3, 3)
arr_flatten = arr.flatten()
arr_flatten[0] = 99
print(arr)
-
A
[[0, 1, 2], [3, 4, 5], [6, 7, 8]]
Correct answer
-
B
[[99, 1, 2], [3, 4, 5], [6, 7, 8]]
-
C
[[0, 99, 2], [3, 4, 5], [6, 7, 8]]
-
D
[[0, 1, 2], [3, 4, 5], [6, 7, 99]]
-
A
It is primarily used for string manipulation
-
B
It is not suitable for mathematical operations
-
C
It provides efficient numerical arrays and functions for numerical operations
Correct answer
-
D
It is a graphical user interface library
-
A
nan
-
B
2.0
Correct answer
-
C
1.5
-
D
3.0
-
A
np.mean()
Correct answer
-
B
mean()
-
C
Both A and B
-
D
None of the above
-
A
To split an array into multiple sub-arrays
-
B
To join arrays along an existing axis
Correct answer
-
C
To create an array with evenly spaced values
-
D
To find the intersection of two arrays
-
A
unique()
-
B
distinct()
-
C
np.unique()
Correct answer
-
D
np.distinct()
-
A
A 2x3 array with random integers between 1 and 10
Correct answer
-
B
An array of random floats between 1 and 10
-
C
A single random integer between 1 and 10
-
D
An error
-
A
np.dot()
Correct answer
-
B
np.cross()
-
C
np.multiply()
-
D
np.inner()
-
A
To adjust array dimensions to perform arithmetic operations
Correct answer
-
B
To increase the speed of array operations
-
C
To convert arrays into a different data type
-
D
None of the above
-
A
Identity matrix of order 3
Correct answer
-
B
Array of zeros with diagonal ones
-
C
Array of ones with diagonal zeros
-
D
Array of ones with all elements zeros
-
A
reshape()
Correct answer
-
B
resize()
-
C
Both A and B
-
D
None of the above
-
A
int32
-
B
string
Correct answer
-
C
float64
-
D
complex128
-
A
Data type of the array
Correct answer
-
B
Dimension of the array
-
C
Shape of the array
-
D
Size of the array
-
A
max()
-
B
maximum()
-
C
np.max()
Correct answer
-
D
np.maximum()
-
A
[0, 1, 2, 3, 4]
Correct answer
-
B
[1, 2, 3, 4, 5]
-
C
[0, 1, 2, 3]
-
D
[1, 2, 3, 4]
-
A
zeros()
Correct answer
-
B
ones()
-
C
empty()
-
D
arange()
-
A
NumPy arrays are resizable
-
B
NumPy arrays can hold elements of different data types
-
C
NumPy arrays support vectorized operations
Correct answer
-
D
NumPy arrays have built-in sorting functions
-
A
Lists
-
B
Sets
-
C
Arrays
Correct answer
-
D
Dictionaries
-
A
Numeric Python
Correct answer
-
B
Numerical Processing
-
C
Natural Python
-
D
None of the above
-
A
Efficient computations
-
B
High-level mathematical functions
-
C
Large, multi-dimensional arrays and matrices
-
D
Built-in machine learning algorithms
Correct answer
-
A
A programming language
-
B
A numerical computing library
Correct answer
-
C
A web development framework
-
D
A database management system