0
0
Pandasdata~10 mins

Exploratory data analysis workflow in Pandas - Interactive Code Practice

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

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

Pandas
import pandas as pd
df = pd.read_csv([1])
Drag options to blanks, or click blank then click option'
A"data.csv"
Bdataframe
Cread_csv
Dpd
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put the file name in quotes
Using a variable name instead of a string
2fill in blank
medium

Complete the code to display the first 5 rows of the DataFrame.

Pandas
print(df.[1]())
Drag options to blanks, or click blank then click option'
Ahead
Btail
Cshow
Ddisplay
Attempts:
3 left
💡 Hint
Common Mistakes
Using tail() which shows the last rows
Using show() which is not a pandas method
3fill in blank
hard

Fix the error in the code to get summary statistics of the DataFrame.

Pandas
summary = df.[1]()
Drag options to blanks, or click blank then click option'
Asummary
Bdescribe
Cinfo
Dstats
Attempts:
3 left
💡 Hint
Common Mistakes
Using info() which shows data types but not statistics
Using non-existent methods like summary()
4fill in blank
hard

Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.

Pandas
lengths = {word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using word instead of len(word) for the value
Using < instead of > in the condition
5fill in blank
hard

Fill all three blanks to create a filtered dictionary with uppercase keys and values greater than 0.

Pandas
result = { [1]: [2] for k, v in data.items() if v [3] 0 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using k.lower() instead of k.upper()
Using < instead of > in the condition