wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FOD_Lab

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

np.arange(1, 10, 3)

a)

[1 4 7 10]

b)

[1 4 7]

c)

[1 3 6 9]

d)

[1 4 7 9]

2.

Which statement about np.linspace(0, 1, 5) is TRUE?

a)

Step size is fixed

b)

End value is excluded

c)

Generates exactly 5 values including 1

d)

Works same as np.arange()

3.

a = np.array([1,2,3])

b = np.array([[1,2,3],[4,5,6]])

print(a + b)

a)

(3,)

b)

(2,3)

c)

(3,2)

d)

Error

4.

What happens when a NumPy array created using view() is modified?

a)

Original array remains unchanged

b)

Only view changes

c)

Both original and view change

d)

Causes runtime error

5.

Which axis value performs column-wise operations in a 2D NumPy array?

a)

axis = -1

b)

axis = 1

c)

axis = 2

d)

axis = 0

6.

What will be the output of the following code?
a = np.array([10, 20, 30])

print(a < 25)

a)

[True False False]

b)

[False False False]

c)

[True True False]

d)

[True False True]

7.

What will be the output of the following code?

a = np.array([1, 2, 3])

b = np.array([1.0, 2.0, 3.0])

print(np.array_equal(a, b))

a)

True

b)

False

c)

Error due to different data types

d)

Depends on NumPy version

8.

The NumPy function used to create a shallow copy that shares memory with the original array is (a)   .

9.

Which NumPy function is used to split an array into multiple sub-arrays horizontally?

a)

np.vsplit()

b)

np.hsplit()

c)

np.column_stack()

d)

np.concatenate()

10.

The NumPy function used to stack arrays column-wise is (a)   .