
NumPy Syntax Quiz

Quiz
•
Computers
•
University
•
Medium
Emily Anne
Used 2+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 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
2 mins • 1 pt
Which of the following arrays is a two-dimensional (2-D) array?
42
[1,2,3,4,5]
[[1,2,3],[4,5,6]]
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is a correct syntax to check the number of dimensions in an array?
arr.dim
arr.ndim
arr.dim()
arr.ndim()
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is a correct syntax to print the first item of an array?
print(myArr,1)
print(myArr[0])
print(myArr[1])
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is a correct syntax to print the number 8 from the array below: arr=np.array([[1,2,3,4,5],[6,7,8,9,10]])
print(arr[3,0])
print(arr[7,2])
print(arr[1,2])
6.
MULTIPLE CHOICE QUESTION
2 mins • 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:4])
print(arr[3:6])
print(arr[2:5])
print(arr[2:6])
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which syntax would print the last 4 numbers from the array below: arr=np.array([1,2,3,4,5,6,7])
print(arr[:4])
print(arr[3:])
print(arr[4])
print(arr[4:])
Create a free account and access millions of resources
Similar Resources on Wayground
30 questions
python ba

Quiz
•
University
25 questions
DSA - Q1

Quiz
•
University
20 questions
Linux 3-4

Quiz
•
University
20 questions
Data Structures and Algorithms Quiz

Quiz
•
University
23 questions
C que que que

Quiz
•
University
30 questions
Aptitude and Computer Science Quiz

Quiz
•
University
30 questions
Python Mock

Quiz
•
University
20 questions
GirlsWhoML Workshop 0

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade