Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to install the scipy package using pip.
SciPy
pip install [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Typing the wrong package name like numpy or pandas.
Forgetting to use pip before install.
✗ Incorrect
To install the scipy package, you use pip install scipy.
2fill in blank
mediumComplete the code to import the scipy library in Python.
SciPy
import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing numpy instead of scipy.
Misspelling the library name.
✗ Incorrect
You import the scipy library using import scipy.
3fill in blank
hardFix the error in the command to install scipy with pip for Python 3.
SciPy
python3 -m [1] install scipy Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using pip3 instead of pip with -m.
Using pipenv which is a different tool.
✗ Incorrect
The correct command uses pip as the module: python3 -m pip install scipy.
4fill in blank
hardFill both blanks to import the optimize submodule from scipy.
SciPy
from [1] import [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing optimize from numpy or stats from scipy incorrectly.
Swapping the order of library and submodule.
✗ Incorrect
You import the optimize submodule from scipy using from scipy import optimize.
5fill in blank
hardFill all three blanks to create a virtual environment named 'env' and activate it.
SciPy
python3 -m [1] [2] source [3]/bin/activate
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using virtualenv instead of venv module.
Using different names for creation and activation.
✗ Incorrect
Use python3 -m venv env to create the environment, then source env/bin/activate to activate it.