0
0
Data Analysis Pythondata~10 mins

Data analysis workflow (collect, clean, explore, visualize, conclude) 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 data from a CSV file using pandas.

Data Analysis Python
import pandas as pd
data = pd.[1]('data.csv')
Drag options to blanks, or click blank then click option'
Aopen_csv
Bload_csv
Cread_csv
Dimport_csv
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent functions like load_csv or open_csv.
Trying to use Python's open() instead of pandas read_csv.
2fill in blank
medium

Complete the code to remove rows with missing values from the DataFrame.

Data Analysis Python
clean_data = data.[1]()
Drag options to blanks, or click blank then click option'
Afillna
Bremove_na
Ccleanna
Ddropna
Attempts:
3 left
💡 Hint
Common Mistakes
Using fillna() which fills missing values instead of removing rows.
Using non-existent methods like remove_na or cleanna.
3fill in blank
hard

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

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

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

Data Analysis Python
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 '<' instead of '>' to filter words.
Using 'word' instead of len(word) for the dictionary values.
5fill in blank
hard

Fill all three blanks to create a dictionary of uppercase keys and values greater than zero.

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 k.upper() for keys.
Using '<' instead of '>' for filtering values.