4.4.3.Practice Quiz Pandas - sj50179/IBM-Data-Science-Professional-Certificate GitHub Wiki

TOTAL POINTS 6

Question 1

What python object do you cast to a dataframe?

  • set
  • tuple
  • dictionary

correct

Question 2

How would you access the first-row and first column in the dataframe df?

  • df.ix[0,0]
  • df.ix[0,1]
  • df.ix[1,0]

correct

Question 3

What is the proper way to load a CSV file using pandas?

  • pandas.from_csv(‘data.csv’)
  • pandas.load_csv(‘data.csv’)
  • pandas.read_csv(‘data.csv’)
  • pandas.import_csv(‘data.csv’)

correct

Question 4

Use this dataframe to answer the question.

How would you select the Genre disco? Select all that apply.

  • df.iloc[6, ‘genre’]
  • df.loc[6, 5]
  • df.iloc[6, 4]

correct

  • df.loc[‘Bee Gees’, ‘Genre’]

Question 5

Use this dataframe to answer the question.

Which will NOT evaluate to 20.6? Select all that apply.

  • df.iloc[4,5]
  • df.iloc[6,5]
  • df.loc[4,’Music Recording Sales’]

correct

  • df.iloc[6, ‘Music Recording Sales (millions)’]

correct

Question 6

Use this dataframe to answer the question.

How do we select Albums The Dark Side of the Moon to Their Greatest Hits (1971-1975)? Select all that apply.

  • df.iloc[2:5, ‘Album’]
  • df.loc[2:5, ‘Album’]

correct

  • df.iloc[2:6, 1]

correct

  • df.loc[2:5, 1]