Save
which function is used to A. np.concatenate
concatenate two arrays along a
specific axis
A. np.concatenate
B. np.split
C. np.vstack
D. np.hstack
how do you import NumPy in Python B. import numpy as np
with an alias?
A. import numpy
B. import numpy as np
C. import numpy. npyb as np
D. import load numpy as nmp
how do you create a Pandas Series A
from a list of values [0.25, 0.5, 0.75,
1.0]
A. pd. Series ([o.25, 0.5,0.75, 1.0])
B. pd. Series ((0.25, 0.5, 0.75, 1.0))
C. pd.Series ({"0.25: "0.5", "0.75": "1.0"})
D. pd.Series (0.25, 0.5, 0.75, 1.0)
,What is the result of the following B
code?data = pd.Series([0.25, 0.5,
0.75, 1.0], index=['a', 'b', 'c',
'd'])data['a':'c']
A. Only the value associated with 'a'
B. The values associated with 'a', 'b',
and 'c'
C. An error, as the slicing is incorrect
D. The values associated with 'a' and
'b' only
How do you create a Pandas Series A
from the dictionary {'a': 0.25, 'b': 0.5,
'c': 0.75}?
A. pd.Series({'a': 0.25, 'b': 0.5, 'c': 0.75})
B. pd.Series(0.25, 0.5, 0.75)
C. pd.Series([0.25, 0.5, 0.75], indexall=
['a', 'b', 'c'])
D. pd.Series({'a', 'b', 'c'})
What does np.linspace(0, 10, 5) do? A
A. Creates an array of 5 evenly
spaced numbers between 0 and 10.
B.Creates an array of 5 random
numbers between 0 and 10.
C. Creates an array of all numbers
between 0 and 10.
D. Creates an array of integers
between 0 and 10.
, What does the following code do: D
arr = np.array([1, 2, 3, 4, 5]); arr[arr >
3]?
AReturns [1, 2, 3]
B.Returns [False, False, False, True,
True]
C. Returns [3, 4]
D. Returns [4, 5]
What is the key difference between a D
NumPy array and a Pandas Series?
A. A NumPy array is always faster if
run on silicone hardware
B. A Series does not have an index.
C. A Series cannot hold mixed data
types.
D. A Series has an explicitly defined
index, while a NumPy array has an
implicitly defined integer index.
What does the following code C
return: arr = np.array([10, 20, 30, 40,
50]); arr[1:4]?
A. [10, 30, 50]
B. [30, 40, 50]
C. [20, 30, 40]
D. [10, 20, 30, 40, 50]