0
0
Data Analysis Pythondata~10 mins

Python vs R vs Excel for analysis in Data Analysis Python - Interactive Practice

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

Complete the code to import the pandas library, which is used for data analysis in Python.

Data Analysis Python
import [1] as pd
Drag options to blanks, or click blank then click option'
Anumpy
Bseaborn
Cmatplotlib
Dpandas
Attempts:
3 left
💡 Hint
Common Mistakes
Importing numpy instead of pandas
Using matplotlib or seaborn which are for plotting
2fill in blank
medium

Complete the code to read a CSV file named 'data.csv' into a pandas DataFrame.

Data Analysis Python
df = pd.[1]('data.csv')
Drag options to blanks, or click blank then click option'
Aread_excel
Bread_csv
Cread_json
Dread_table
Attempts:
3 left
💡 Hint
Common Mistakes
Using read_excel for CSV files
Using read_json or read_table incorrectly
3fill in blank
hard

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

Data Analysis Python
mean_age = df['Age'].[1]()
Drag options to blanks, or click blank then click option'
Amean
Bcount
Csum
Dmedian
Attempts:
3 left
💡 Hint
Common Mistakes
Using sum() instead of mean()
Using count() which counts entries
Using median() which finds the middle value
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each word to its length if the length is greater than 3.

Data Analysis Python
{word: [1] for word in words if [2] > 3}
Drag options to blanks, or click blank then click option'
Alen(word)
Bword
Clen(words)
Dword.length
Attempts:
3 left
💡 Hint
Common Mistakes
Using word instead of len(word) for length
Using len(words) which is the length of the list, not the word
5fill in blank
hard

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

Data Analysis Python
{ [1]: [2] for [3], [2] in word_counts.items() if [2] > 1 }
Drag options to blanks, or click blank then click option'
Aword.upper()
Bcount
Cword
Dword_counts
Attempts:
3 left
💡 Hint
Common Mistakes
Using word_counts as a loop variable
Mixing up keys and values
Not converting word to uppercase