Python Test 2

Python Test 2

University

19 Qs

quiz-placeholder

Similar activities

Numpy

Numpy

University

15 Qs

numpy library

numpy library

University

15 Qs

Libreria numpy python

Libreria numpy python

University

21 Qs

GCH1003 Pytho Array & List

GCH1003 Pytho Array & List

University

18 Qs

Data Analytics using Python - Quiz 2

Data Analytics using Python - Quiz 2

University

15 Qs

Python Pandas Series

Python Pandas Series

University

15 Qs

Numpy

Numpy

University

20 Qs

Scipy

Scipy

University

20 Qs

Python Test 2

Python Test 2

Assessment

Quiz

Computers

University

Medium

Created by

Peter Parfenov

Used 1+ times

FREE Resource

19 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

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

b = a.flatten()

print(len(a), len(b))

6 2

2 3

3 6

3 2

2.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

What do you expect from this code (more than 1 answer)?

import numpy as np

a = np.arange(4)

b = a / 0

print(b)

[nan nan nan]

[nan inf inf inf]

Zero Division Warning

[inf inf inf inf]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.linspace(1, 3, 3) ** 3

x = a > 20

print(x)

[False False True]

[True True False]

[True True True]

[False False False]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

x1 = np.linspace(0, 5, 5, endpoint=False)

y1 = np.linspace(0, 5, 5, endpoint=True)

x2 = np.linspace(0, 5, 5, endpoint=False)

y2 = np.linspace(0, 4, 5, endpoint=True)

print(np.sum(x1) == np.sum(y1), np.sum(x2) == np.sum(y2))

[True True]

[False False]

[True False]

[False True]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.arange(2)

b = np.arange(2, 0, -1)

print(a == b)

[False True]

[True True]

[False False]

[True False]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.array(((1, 0, 1), (0, 1, 0)))

print(a.size)

3

2

6

(2, 6)

(2, 3)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.array(((1, 0, 1), (0, 1, 0)))

print(a.ndim)

2

3

6

(2, 3)

(2, 6)

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?