BADM /
211
/ /
Midterm
/ /
Review
/ /
(practice questions with correct answers)
/ // // // // //
What //is //the //output //of //the //following //lines //of //code: //
word //= //"BADM"
word //= //211
print(word) //- //CORRECT //ANSWERS(S)✔✔211
What //will //the //result //of //the //following //code?
2 //* //"3.0" //- //CORRECT //ANSWERS(S)✔✔"3.03.0"
Which /
/of //the //following //pandas //methods //will //report //summary //statistics //of //numeric //columns?
A. //head()
B. //tail()
C. //info()
D. //describe() //- //CORRECT //ANSWERS(S)✔✔D. //describe()
Suppose /
/we /
/have //
a/
, /data /
/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"]) //- //CORRECT //ANSWERS(S)✔✔A. //df["animal"].value_counts()
Which /
/option /
/will /
/help /
/us //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] //- //CORRECT //ANSWERS(S)✔✔A. //L[0:2] //AND //D. //L[-3:-1]
211
/ /
Midterm
/ /
Review
/ /
(practice questions with correct answers)
/ // // // // //
What //is //the //output //of //the //following //lines //of //code: //
word //= //"BADM"
word //= //211
print(word) //- //CORRECT //ANSWERS(S)✔✔211
What //will //the //result //of //the //following //code?
2 //* //"3.0" //- //CORRECT //ANSWERS(S)✔✔"3.03.0"
Which /
/of //the //following //pandas //methods //will //report //summary //statistics //of //numeric //columns?
A. //head()
B. //tail()
C. //info()
D. //describe() //- //CORRECT //ANSWERS(S)✔✔D. //describe()
Suppose /
/we /
/have //
a/
, /data /
/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"]) //- //CORRECT //ANSWERS(S)✔✔A. //df["animal"].value_counts()
Which /
/option /
/will /
/help /
/us //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] //- //CORRECT //ANSWERS(S)✔✔A. //L[0:2] //AND //D. //L[-3:-1]