Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import pandas in Google Colab.
Data Analysis Python
import [1] as pd
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing numpy instead of pandas.
Using wrong alias like 'pn' instead of 'pd'.
✗ Incorrect
We use import pandas as pd to work with data tables in Python.
2fill in blank
mediumComplete the code to read a CSV file in Google Colab.
Data Analysis Python
df = pd.read_csv('[1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using only filename without path.
Using Google Drive share URL directly.
✗ Incorrect
In Colab, files in the sample_data folder can be accessed with /content/sample_data/filename.
3fill in blank
hardFix the error in the code to mount Google Drive in Colab.
Data Analysis Python
from google.colab import [1] [1].mount('/content/drive')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing wrong module like files or auth.
Forgetting to mount after import.
✗ Incorrect
The drive module from google.colab is used to mount Google Drive.
4fill in blank
hardFill both blanks to list files in the mounted Google Drive folder.
Data Analysis Python
import os files = os.[1]('[2]') print(files)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using os.walk which returns a generator, not a list.
Using wrong path like sample_data instead of MyDrive.
✗ Incorrect
os.listdir lists files in a directory. The path to Google Drive is /content/drive/MyDrive.
5fill in blank
hardFill all three blanks to save a DataFrame to Google Drive in CSV format.
Data Analysis Python
df.[1]('[2]/[3].csv', index=False)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using read_csv instead of to_csv.
Saving to wrong folder path.
✗ Incorrect
Use to_csv to save DataFrame. The path is Google Drive folder plus filename.