update} QUESTIONS AND ANSWERS 100%
CORRECT
What is the MISSING row in the middle of the for loop?(replace the word MISSING with
the right code)
Total=0
For metas in range (1, 5):
MISSING
Print(total) - correct answer total += metas
Imagine we have a dataframe, df. What would be the purpose for running code like the
one below? (why would we run it?)
Df.loc[1] - correct answer To look for, retrieve a value from df
,Imagine we have a pandas dataframe we have named 'df'.
The dataframe consists of 2 columns.
"col1" is 30 values long, and is a random mix of the letters 'a', 'b', and 'c'.
"num1" is also 30 values long, and is a random set of numerical data (all integers).
Which of the following would give you the mean of the numerical (num1) column,
grouped by the values from column "col1"? - correct answer df.groupby('col1'). Mean()
What is the shape of the following numpy array?
Np.random.seed(1955)x = np.random.randn(2, 2, 2, 2)
Print(x.shape)
,X
#Hint: I have not loaded the necessary package here...but you should(load pandas,
import numpy) - correct answer (2, 2, 2, 2)
What is the output of the following code?
Import numpy as np
List1 = [5, 5, 5]
List2 = [10, 10, 10]
Np_list1 = np.array(list1)
Np_list2 = np.array(list2)
Np_list1/np_list2 - correct answer array([0.5, 0.5 0.5])
, Numpy allows us to do more complicated math on lists and other data structures, and
is used in most of the more advanced modules we will use (such as pandas) - correct
answer true
Pandas can be imported as import pandas as pd - correct answer true
Usually a programmer will use conventional names when importing packages. But it is
not strictly necessary. Numpy for example can be imported as: import numpy as
humpty_dumpty - correct answer true
Pandas allows us to use multiple different data types (like objects and numbers) in a
single table. - correct answer true
For pandas to work, data must be formatted as lists before it is imported - correct
answer false