0
0
Data Analysis Pythondata~10 mins

Why Python is the top choice for data analysis in Data Analysis Python - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the popular data analysis library in Python.

Data Analysis Python
import [1] as pd
Drag options to blanks, or click blank then click option'
Anumpy
Bpandas
Cscipy
Dmatplotlib
Attempts:
3 left
💡 Hint
Common Mistakes
Using numpy instead of pandas for data frames.
Importing matplotlib which is for plotting, not data manipulation.
2fill in blank
medium

Complete the code to read a CSV file into a pandas DataFrame.

Data Analysis Python
df = pd.[1]('data.csv')
Drag options to blanks, or click blank then click option'
Aload_csv
Bto_csv
Copen_csv
Dread_csv
Attempts:
3 left
💡 Hint
Common Mistakes
Using to_csv which saves data instead of reading.
Using load_csv or open_csv which are not pandas functions.
3fill in blank
hard

Fix the error in the code to display the first 5 rows of the DataFrame.

Data Analysis Python
print(df.[1]())
Drag options to blanks, or click blank then click option'
Adisplay
Bshow
Chead
Dtail
Attempts:
3 left
💡 Hint
Common Mistakes
Using tail() which shows the last rows.
Using show() or display() which are not pandas DataFrame methods.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps words to their lengths only if the length is greater than 3.

Data Analysis Python
{word: [1] for word in words if [2]
Drag options to blanks, or click blank then click option'
Alen(word)
Bword > 3
Clen(word) > 3
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using word > 3 which compares string to number.
Not using len() to get word length.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase words to their counts only if count is greater than 1.

Data Analysis Python
{ [1]: [2] for [3], [2] in data.items() if [2] > 1 }
Drag options to blanks, or click blank then click option'
Aword.upper()
Bcount
Cword
Ddata
Attempts:
3 left
💡 Hint
Common Mistakes
Using data instead of word in the loop variable.
Not converting word to uppercase.
Using count variable incorrectly.