prompt: Return `a` reshaped to shape (8, 5) in C order.


prompt: Return the element-wise absolute value of `a`.


prompt: Return `a` sorted in ascending order.


prompt: Return the cumulative sum of `a`.


prompt: Clip `a` to the range [-2, 2] and return the result.


prompt: Return only the strictly positive elements of `a`, in their original order.


prompt: Return the indices that would sort `a` ascending, as an int64 array.


prompt: Return `m` transposed.


prompt: Return the row-wise sums of `g` as a 1-D array.


prompt: Normalise each column of `g` to zero mean and unit standard deviation (population std, ddof=0).


prompt: Return the pairwise differences between consecutive elements of `a`.


prompt: Return `a` with every element rounded to 2 decimal places.


category: linalg

prompt: Return the matrix product of `m` with itself.


category: linalg

prompt: Return the inverse of `s`.


category: linalg

prompt: Return the eigenvalues of `s` as a 1-D array sorted ascending. `s` is symmetric, so use a symmetric eigensolver.


category: linalg

prompt: Return the lower-triangular Cholesky factor of `s`.


category: linalg

prompt: Solve s @ x = b where b is a vector of ones of the right length, and return x.


category: linalg

prompt: Return the singular values of `m` as a 1-D array, in descending order.


category: linalg

prompt: Return the QR decomposition's R factor for `m`.


category: linalg

prompt: Return the matrix exponential of `m` using scipy.linalg.


category: linalg

prompt: Return the Moore-Penrose pseudo-inverse of `g`.


category: linalg

prompt: Return a 1-element array containing the determinant of `s`.


category: statistics

prompt: Return a 1-D array [mean, median, population standard deviation (ddof=0)] of `a`.


category: statistics

prompt: Return the 25th, 50th and 75th percentiles of `a` as a 1-D array, using linear interpolation.


category: statistics

prompt: Return the z-scores of `a` (population std, ddof=0) using scipy.stats.


category: statistics

prompt: Return the Pearson correlation matrix of `g`'s columns.


category: statistics

prompt: Return the column-wise covariance matrix of `g` with ddof=1.


category: statistics

prompt: Return a 1-element array with the chi-square statistic from a chi-square test of independence on the contingency table `c`.


category: statistics

prompt: Return a 1-D array [slope, intercept] of the least-squares line fitting `a` against the index 0..len(a)-1.


category: statistics

prompt: Return the ranks of `a` using scipy.stats.rankdata with the default average method.


category: signal

prompt: Return the magnitude spectrum of the real FFT of `sig`.


category: signal

prompt: Return the real FFT frequencies for `sig` assuming a sample spacing of 1/128.


category: signal

prompt: Return `sig` convolved with a length-5 moving-average kernel using scipy.signal.convolve in 'same' mode.


category: signal

prompt: Return the discrete cosine transform (type 2, norm='ortho') of `sig`.


category: signal

prompt: Return `sig` detrended linearly using scipy.signal.detrend.


category: signal

prompt: Return the indices of local maxima in `sig` found by scipy.signal.find_peaks with default arguments, as an int64 array.


category: optimization

prompt: Fit a degree-2 polynomial to `a` against the index 0..len(a)-1 with numpy.polyfit and return the coefficients (highest power first).


category: optimization

prompt: Return the least-squares solution x to g @ x = b, where b is a vector of ones of the right length. Use numpy.linalg.lstsq with rcond=None.


category: optimization

prompt: Minimise the function f(x) = (x[0]-3)**2 + (x[1]+1)**2 with scipy.optimize.minimize starting from [0, 0] using method 'BFGS', and return the located minimiser x rounded to 6 decimals.


category: optimization

prompt: Find the root of f(x) = x**3 - 2x - 5 on the bracket [1, 3] with scipy.optimize.brentq and return it as a 1-element array rounded to 9 decimals.