stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Numpy Flashcards | StudBud
Explore
/
Numpy
Numpy
15 terms
·
StudBud Administration
Imported from external platform
Flashcards
15 cards
F
Practice quiz
P
Host live
L
Questions
15
Answers
1
Which function is used to concatenate two arrays along a specified axis
np.concatenate()
np.append()
np.combine()
np.add()
2
What does np.arange(10, 20, 2) generate?
An array of numbers from 10 to 20, including 20, with a step of 2
An array of numbers from 10 to 19 with a step of 2
An array of numbers from 10 to 20, excluding 20, with a step of 2
An array of numbers from 10 to 20 with a step of 1
3
What does np.flatten() do to a multi-dimensional array?
Converts it to a 1D array
Sorts the array in ascending order
Removes all zeros from the array
Removes duplicate elements
4
How do you create a 3D array of ones with dimensions (2, 3, 4)?
np.ones([2, 4, 3])
np.ones((2, 3, 4))
np.ones((4, 3, 2))
np.ones([3, 4, 2])
5
Which command is used to import NumPy in Python?
import numpy as np
use numpy
import numpy.array
include numpy
6
Which function is used to stack arrays vertically?
np.hstack()
np.dstack()
np.concatenate()
np.vstack()
7
What is NumPy primarily used for?
Numerical computations
Building mobile apps
Creating games
Web development
8
What does np.random.rand(3, 2) generate?
A 3x2 array of zeros
A 3x2 identity matrix
A 3x2 array of random floats between 0 and 1
A 3x2 array of random integers
9
How can you check for duplicate elements in a NumPy array?
np.duplicates()
np.unique()
np.check_duplicates()
np.copy()
10
Which function is used to generate an array of evenly spaced values in a range?
np.arange()
np.split()
np.range()
np.linspace()
11
What does np.zeros((3, 3)) do?
Creates an empty 3x3 array
Creates a 3x3 array filled with ones
Creates a 3x3 array filled with zeros
Creates a 3x3 array with random values
12
Which function is used to find the shape of a NumPy array?
array.length
array.size
array.shape
array.type
13
What is the output of np.dot(a, b)?
Division of elements in a by b
Element-wise multiplication
Element-wise addition
Matrix product of a and b
14
What will np.array([1, 2, 3]) * 2 return?
[1, 2, 3]
[2, 4, 6]
[1, 2, 3, 1, 2, 3]
[1, 2, 6]
15
What does the np.array() function do?
Sorts an array
Creates a list
Creates a NumPy array
Deletes an array