0
0
SciPydata~10 mins

SciPy module organization - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the submodule for optimization from SciPy.

SciPy
from scipy import [1]
Drag options to blanks, or click blank then click option'
Astats
Bintegrate
Ccluster
Doptimize
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the wrong submodule like 'stats' instead of 'optimize'.
Trying to import the whole SciPy module instead of a submodule.
2fill in blank
medium

Complete the code to use the SciPy submodule for statistical functions.

SciPy
import scipy.[1] as stats
result = stats.sem([1, 2, 3, 4])
Drag options to blanks, or click blank then click option'
Astats
Boptimize
Cintegrate
Dlinalg
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'optimize' or 'integrate' submodules for statistics.
Not importing the submodule before using its functions.
3fill in blank
hard

Fix the error in the code to correctly import the linear algebra submodule from SciPy.

SciPy
from scipy import [1]
result = [1].inv([[1, 2], [3, 4]])
Drag options to blanks, or click blank then click option'
Aoptimize
Blinalg
Cfftpack
Dstats
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stats' or 'optimize' submodules for linear algebra.
Not matching the imported submodule name with its usage.
4fill in blank
hard

Fill both blanks to create a dictionary that maps each SciPy submodule name to its description.

SciPy
submodules = {
    'optimize': 'functions for [1]',
    'integrate': 'tools for [2]'
}
Drag options to blanks, or click blank then click option'
Aoptimization
Bintegration
Cstatistics
Dlinear algebra
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the descriptions of submodules.
Using unrelated terms like 'statistics' for 'integrate'.
5fill in blank
hard

Fill all three blanks to create a dictionary that maps submodule names to their common function names.

SciPy
common_funcs = {
    'stats': '[1]',
    'linalg': '[2]',
    'optimize': '[3]'
}
Drag options to blanks, or click blank then click option'
Asem
Binv
Cminimize
Dintegrate
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing function names between submodules.
Using 'integrate' as a function name for these submodules.