Search Header Logo

Python - Numpy Quiz 1

Authored by Max Diender

Professional Development, Computers

University - Professional Development

Used 59+ times

Python - Numpy Quiz 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is a correct syntax to create a NumPy array?

np.createArray([1, 2, 3, 4, 5])

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

np.object([1, 2, 3, 4, 5])

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is a correct syntax to print the numbers [3, 4, 5] from the array below:


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

print(arr[2:5])

print(arr[2:6])

print(arr[2:4])

print(arr[3:6])

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is a correct syntax to return the shape of an array?

shape(arr)

arr.shape

arr.shape()

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the correct syntax to reshape the array below into 4 arrays with 3 elements?


arr = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])

newarr = arr.reshape(3, 4)

newarr = arr.shape(3, 4)

newarr = arr.reshape(4, 3)

newarr = arr.shape(4, 3)

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is a correct method to join two or more arrays?

np.join()

np.array_join()

np.concatenate()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Professional Development