Complete the code to import the SciPy library.
import [1]
We use import scipy to bring the SciPy library into our program.
Complete the code to calculate the mean of the array using SciPy.
from scipy import stats data = [1, 2, 3, 4, 5] mean_value = stats.[1](data).mean
The describe function returns descriptive statistics including the mean.
Fix the error in the code to compute the Euclidean distance between two points using SciPy.
from scipy.spatial import distance point1 = (1, 2) point2 = (4, 6) dist = distance.[1](point1, point2)
The euclidean function computes the straight-line distance between two points.
Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.
words = ['apple', 'bat', 'carrot', 'dog'] lengths = {word: [1] for word in words if len(word) [2] 3}
We use len(word) to get the length and filter words with length greater than 3.
Fill all three blanks to create a dictionary of uppercase words and their lengths for words longer than 3 characters.
words = ['apple', 'bat', 'carrot', 'dog'] result = { [1]: [2] for w in words if len(w) [3] 3}
The dictionary keys are uppercase words using w.upper(), values are lengths, and we filter words longer than 3.