BADM 211 Midterm Review (Practice Problems
With Solutions)
Save
Terms in this set (17)
What is the output of the 211
following lines of code:
word = "BADM"
word = 211
print(word)
What will the result of the "3.03.0"
following code?
2 * "3.0"
Which of the following D. describe()
pandas methods will
report summary statistics
of numeric columns?
A. head()
B. tail()
C. info()
D. describe()
, Suppose we have a data A. df["animal"].value_counts()
frame df, which includes
a column animal. I would
like to count the number
of times each animal
appears in the column,
e.g. Elephant: 8, Zebra: 7,
etc. Which of the
following commands can
I use to do that?
A.
df["animal"].value_counts(
)
B.
df["animal"].value_counts(
normalize=True)
C.
df.value_counts().animal()
D.
value_counts(df["animal"])
Which option will help us A. L[0:2] AND D. L[-3:-1]
select elements "a" and
"b" in the list L = ["a", "b",
"c"]? (Select all that
apply.)
A. L[0:2]
B. L[1:2]
C. L[-3:-2]
D. L[-3:-1]
Which of these will help C. df[["c1","c2"]]
us select two columns, c1
and c2, from the
dataframe df?
A. df[c1,c2]
B. df["c1", "c2"]
C. df[["c1","c2"]]
D. df("c1", "c2")
With Solutions)
Save
Terms in this set (17)
What is the output of the 211
following lines of code:
word = "BADM"
word = 211
print(word)
What will the result of the "3.03.0"
following code?
2 * "3.0"
Which of the following D. describe()
pandas methods will
report summary statistics
of numeric columns?
A. head()
B. tail()
C. info()
D. describe()
, Suppose we have a data A. df["animal"].value_counts()
frame df, which includes
a column animal. I would
like to count the number
of times each animal
appears in the column,
e.g. Elephant: 8, Zebra: 7,
etc. Which of the
following commands can
I use to do that?
A.
df["animal"].value_counts(
)
B.
df["animal"].value_counts(
normalize=True)
C.
df.value_counts().animal()
D.
value_counts(df["animal"])
Which option will help us A. L[0:2] AND D. L[-3:-1]
select elements "a" and
"b" in the list L = ["a", "b",
"c"]? (Select all that
apply.)
A. L[0:2]
B. L[1:2]
C. L[-3:-2]
D. L[-3:-1]
Which of these will help C. df[["c1","c2"]]
us select two columns, c1
and c2, from the
dataframe df?
A. df[c1,c2]
B. df["c1", "c2"]
C. df[["c1","c2"]]
D. df("c1", "c2")