Quiz: Which operator performs true linear algebra matrix multiplication between two 2D NumPy arrays in Python 3.5+?
The @ operator ( np.matmul ) computes the dot/matrix product, whereas * performs element-wise multiplication.
Find tutorials, system documentation, dynamic pages, and interactive quizzes in one place.
The @ operator ( np.matmul ) computes the dot/matrix product, whereas * performs element-wise multiplication.
Passing -1 signals NumPy to dynamically compute that dimension based on the total elements and specified dimensions.
.loc[] indexes by index/column labels and includes the stop slice; .iloc[] indexes by 0-based integer positions and excludes the stop slice.
df.fillna() fills NaN values using a specified scalar, dictionary, or imputation strategy (e.g. forward/back fill).
pd.to_datetime() parses string timestamps into DatetimeIndex/Series, and the .dt accessor exposes vectorized calendar properties.
scipy.optimize provides functions like minimize() , curve_fit() , and root() for mathematical optimization.
scipy.stats.norm.pdf(x, loc, scale) evaluates the Gaussian probability density function where loc is mean and scale is standard deviation.
Never invert matrices directly: scipy.linalg.solve uses efficient LU/Cholesky decomposition , avoiding instability and O(n³) cost.