Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to install the pandas library using pip.
Pandas
pip install [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Typing a different library name like numpy or matplotlib.
Forgetting to use pip before install.
✗ Incorrect
The command pip install pandas installs the pandas library, which is used for data analysis in Python.
2fill in blank
mediumComplete the code to import pandas with the common alias.
Pandas
import [1] as pd
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the wrong library.
Not using the alias or using a different alias.
✗ Incorrect
We import pandas as pd to use a short and common alias for easier coding.
3fill in blank
hardFix the error in the command to upgrade pandas using pip.
Pandas
pip install --[1] pandas Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'update' instead of 'upgrade'.
Forgetting the double dashes before the option.
✗ Incorrect
The correct pip option to upgrade a package is --upgrade.
4fill in blank
hardFill both blanks to check the installed pandas version in Python.
Pandas
import pandas as [1] print(pd.[2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'version' or 'ver' instead of '__version__'.
Using a different alias than 'pd'.
✗ Incorrect
We import pandas as pd and print pd.__version__ to see the installed version.
5fill in blank
hardFill all three blanks to create a DataFrame after installing pandas.
Pandas
import [1] as pd data = {'Name': ['Alice', 'Bob'], 'Age': [25, 30]} df = pd.[2]([3]) print(df)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Series' instead of 'DataFrame'.
Passing wrong variable name to the constructor.
✗ Incorrect
We import pandas as pd, then create a DataFrame from the dictionary data using pd.DataFrame(data).