0
0
Data Analysis Pythondata~10 mins

Jupyter Notebook best practices 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 add a markdown cell with a title in Jupyter Notebook.

Data Analysis Python
# [1] This is a title
Drag options to blanks, or click blank then click option'
Adef
Bprint
Cimport
D#
Attempts:
3 left
💡 Hint
Common Mistakes
Using print instead of markdown syntax.
Trying to write code instead of markdown.
2fill in blank
medium

Complete the code to import pandas library in a Jupyter Notebook cell.

Data Analysis Python
[1] pandas as pd
Drag options to blanks, or click blank then click option'
Aexport
Binclude
Cimport
Drequire
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'export' or 'require' which are not Python keywords.
Forgetting to alias pandas as pd.
3fill in blank
hard

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

Data Analysis Python
df.[1]()
Drag options to blanks, or click blank then click option'
Ashow
Bhead
Cprint
Ddisplay
Attempts:
3 left
💡 Hint
Common Mistakes
Using print() which prints the whole DataFrame.
Using show() which is not a pandas method.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps words to their lengths only if 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
Clen(word) > 3
Dword > 3
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word itself as the value instead of its length.
Using the word in the condition instead of its 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 0.

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