What is a correct syntax to create a NumPy array?

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
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
21 questions
Libreria numpy python

Quiz
•
University
20 questions
Season 5 #Spaic Python Weekly Quiz

Quiz
•
KG - Professional Dev...
25 questions
Java - SET -1

Quiz
•
University
21 questions
quiz 2nd/3rd year

Quiz
•
University
20 questions
Beginner Quiz on ML and Python Basics

Quiz
•
University
20 questions
Pointers

Quiz
•
University
20 questions
Numpy

Quiz
•
University
20 questions
Sjmit-Q2-[Workshop-MAR-25]

Quiz
•
12th Grade - University
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade