0
0
Pandasdata~20 mins

Installing Pandas - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pandas Installation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why is it important to install Pandas before using it?

Imagine you want to use a tool to organize your data, but the tool is not yet in your toolbox. Why must you install Pandas before you can use it in Python?

ABecause Pandas is not included in Python by default, so you need to add it to your environment first.
BBecause installing Pandas automatically updates Python to the latest version.
CBecause Pandas is a built-in Python module and does not require installation.
DBecause installing Pandas removes other data science libraries to avoid conflicts.
Attempts:
2 left
💡 Hint

Think about what happens when you try to use a tool that is not yet available on your computer.

Predict Output
intermediate
2:00remaining
What happens if you try to import Pandas without installing it?

Look at the code below. What will be the output if Pandas is not installed?

Pandas
import pandas as pd
print(pd.__version__)
ASyntaxError because 'import' is used incorrectly.
BIt prints the version number of Pandas installed.
CModuleNotFoundError: No module named 'pandas'
DNameError because 'pd' is not defined.
Attempts:
2 left
💡 Hint

What error does Python give when you try to import a library that is not installed?

data_output
advanced
2:00remaining
What is the output of the installation command?

When you run the command pip install pandas in your terminal, what is the expected output if the installation is successful?

APython interpreter starts running.
BError: pandas package not found.
CNo output is shown after running the command.
DSuccessfully installed pandas-<version> and its dependencies.
Attempts:
2 left
💡 Hint

Think about what a package manager shows when it finishes installing a package.

🔧 Debug
advanced
2:00remaining
Why does this installation command fail?

Look at the command below. Why will it fail to install Pandas?

pip install panda
ABecause the package name is misspelled; it should be 'pandas' not 'panda'.
BBecause pip cannot install packages without internet connection.
CBecause 'pip install' requires Python version 2, not 3.
DBecause 'panda' is a built-in Python module and does not need installation.
Attempts:
2 left
💡 Hint

Check the exact spelling of the package name.

🚀 Application
expert
3:00remaining
How to verify Pandas installation in Python code?

You want to write a small Python script that checks if Pandas is installed and prints its version. Which code snippet will do this correctly?

A
import pandas as pd
print(pd.version())
B
try:
    import pandas as pd
    print(pd.__version__)
except ImportError:
    print('Pandas is not installed')
C
if 'pandas' in sys.modules:
    print('Pandas installed')
else:
    print('Not installed')
D
import pandas
print(pandas.version())
Attempts:
2 left
💡 Hint

Think about how to handle the case when a module is missing.