0
0
Data Analysis Pythondata~10 mins

Why flexible I/O handles real-world data in Data Analysis Python - Test Your Understanding

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

Complete the code to read a CSV file using pandas.

Data Analysis Python
import pandas as pd
data = pd.read_csv([1])
Drag options to blanks, or click blank then click option'
A'data.csv'
Bdata.csv
Cread.csv
Dcsv.read
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the file name
Using wrong function names
2fill in blank
medium

Complete the code to read a JSON file into a pandas DataFrame.

Data Analysis Python
import pandas as pd
data = pd.read_json([1])
Drag options to blanks, or click blank then click option'
Adata.json
B'data.json'
Cjsonfile
Dread.json
Attempts:
3 left
💡 Hint
Common Mistakes
Passing variable names without quotes
Using incorrect function names
3fill in blank
hard

Fix the error in the code to read a CSV file with a custom delimiter.

Data Analysis Python
import pandas as pd
data = pd.read_csv('data.csv', delimiter=[1])
Drag options to blanks, or click blank then click option'
A'delimiter'
B;
C';'
D,
Attempts:
3 left
💡 Hint
Common Mistakes
Using delimiter without quotes
Using wrong delimiter character
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
words = ['data', 'is', 'fun', 'and', 'easy']
lengths = {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 word instead of len(word) for values
Incorrect condition in if clause
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase words to their lengths only if length is greater than 3.

Data Analysis Python
words = ['data', 'is', 'fun', 'and', 'easy']
lengths = {{ [1]: [2] for word in words if [3] }}
Drag options to blanks, or click blank then click option'
Aword.upper()
Blen(word)
Clen(word) > 3
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Not converting words to uppercase
Using word instead of len(word) for values
Wrong filter condition