Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import pandas with the common alias.
Pandas
import pandas as [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pn' or 'ps' which are not standard aliases.
Not using an alias at all.
✗ Incorrect
The common alias for pandas is 'pd'. This is widely used in data science code.
2fill in blank
mediumComplete the code to import only the DataFrame class from pandas.
Pandas
from pandas import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing Series instead of DataFrame.
Importing Panel which is deprecated.
✗ Incorrect
DataFrame is the main 2D data structure in pandas, often imported directly.
3fill in blank
hardFix the error in the import statement to use the common pandas alias.
Pandas
import pandas as [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pandas' as alias which is redundant.
Using uncommon aliases like 'pan' or 'pnd'.
✗ Incorrect
The standard alias for pandas is 'pd', not the full name or other variants.
4fill in blank
hardFill both blanks to import pandas and create a DataFrame using the alias.
Pandas
[1] as pd df = pd.[2]({'A': [1, 2], 'B': [3, 4]})
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'from pandas import DataFrame' but then calling pd.DataFrame.
Using 'read_csv' instead of 'DataFrame' to create the DataFrame.
✗ Incorrect
You import pandas as pd, then create a DataFrame using pd.DataFrame().
5fill in blank
hardFill all three blanks to import pandas, create a Series, and print it.
Pandas
[1] as pd s = pd.[2]([10, 20, 30]) print([3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using DataFrame instead of Series to create s.
Printing pd.Series instead of the variable s.
✗ Incorrect
Import pandas as pd, create a Series with pd.Series(), then print the Series variable s.