Array-Oriented Programming with NumPy Flashcards

1
Q

(Fill-In) The NumPy library provides the ______ data structure, which is typically much faster than lists.

A

ndarray.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

(Fill-In) Function array creates an array from ______.

A

an array or other collection of elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

(True/False) By default, NumPy displays trailing 0s to the right of the decimal point in a floating-point value.

A

False. By default, NumPy does not display trailing 0s in the fractional part of a floating-point value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

(Fill-In) NumPy function ______ returns an ndarray containing evenly spaced floating-point values.

A

linspace.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

(True/False) When one of the operands of an array operator is a scalar, NumPy uses broadcasting to perform the calculation as if the scalar were an array of the same shape as the other operand, but containing the scalar value in all its elements.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

(Fill-In) NumPy functions and calculate variance and standard deviation, respectively.

A

var, std.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

(Fill-In) NumPy offers dozens of standalone functions, which it calls _____.

A

universal functions (or ufuncs).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

(Fill-In) A view is also known as a(n) ______.

A

shallow copy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

(True/False) The array method copy returns a new array that is a view (shallow copy) of the original array.

A

False. The array method copy produces a deep copy of the original array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

(True/False) Module copy provides function deep_copy, which returns a deep copy of its argument.

A

False. The name of the function is deepcopy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly