0
0
Data Analysis Pythondata~10 mins

First data analysis walkthrough in Data Analysis Python - 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 the CSV file into a DataFrame.

Data Analysis Python
import pandas as pd

df = pd.[1]('data.csv')
Drag options to blanks, or click blank then click option'
Aread_csv
Bread_excel
Cto_csv
Dread_json
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'read_excel' for CSV files.
Using 'to_csv' which is for saving files.
2fill in blank
medium

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

Data Analysis Python
print(df.[1]())
Drag options to blanks, or click blank then click option'
Ahead
Btail
Csample
Dinfo
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'tail' which shows the last rows.
Using 'info' which shows summary info, not rows.
3fill in blank
hard

Fix the error in the code to calculate the mean of the 'age' column.

Data Analysis Python
mean_age = df['age'].[1]()
Drag options to blanks, or click blank then click option'
Asum
Bmean
Ccount
Dmedian
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'sum' which adds values but does not average.
Using 'count' which counts non-null values.
4fill in blank
hard

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

Data Analysis Python
lengths = {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.
Using 'word' instead of length in the dictionary value.
5fill in blank
hard

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

Data Analysis Python
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 uppercase.
Using '<' instead of '>' for filtering.