About 50 results
Open links in new tab
  1. numpy.multiply — NumPy v2.4 Manual

    The * operator can be used as a shorthand for np.multiply on ndarrays. >>> x1 = np.arange(9.0).reshape((3, 3)) >>> x2 = np.arange(3.0) >>> x1 * x2 array([[ 0., 1., 4.], [ 0., 4., 10.], [ …

  2. numpy.dot — NumPy v2.4 Manual

    If both a and b are 2-D arrays, it is matrix multiplication, but using matmul or a @ b is preferred. If either a or b is 0-D (scalar), it is equivalent to multiply and using numpy.multiply(a, b) or a * b is preferred.

  3. numpy.matmul — NumPy v2.4 Manual

    Multiplication by scalars is not allowed, use * instead. Stacks of matrices are broadcast together as if the matrices were elements, respecting the signature (n,k),(k,m)->(n,m):

  4. numpy.cross — NumPy v2.4 Manual

    The cross product of a and b in R 3 is a vector perpendicular to both a and b. If a and b are arrays of vectors, the vectors are defined by the last axis of a and b by default, and these axes can have …

  5. Linear algebra — NumPy v2.4 Manual

    This generalizes to linear algebra operations on higher-dimensional arrays: the last 1 or 2 dimensions of a multidimensional array are interpreted as vectors or matrices, as appropriate for each operation.

  6. Broadcasting — NumPy v2.4 Manual

    Broadcasting provides a means of vectorizing array operations so that looping occurs in C instead of Python. It does this without making needless copies of data and usually leads to efficient algorithm …

  7. NumPy: the absolute basics for beginners — NumPy v2.4 Manual

    For clarity, it is best to avoid the mathematical terms when referring to an array because the mathematical objects with these names behave differently than arrays (e.g. “matrix” multiplication is …

  8. The N-dimensional array (ndarray) — NumPy v2.4 Manual

    As with other container objects in Python, the contents of an ndarray can be accessed and modified by indexing or slicing the array (using, for example, N integers), and via the methods and attributes of …

  9. NumPy for MATLAB users — NumPy v2.4 Manual

    For array, * means element-wise multiplication, while @ means matrix multiplication; they have associated functions multiply() and dot(). For matrix, * means matrix multiplication, and for element …

  10. numpy.einsum — NumPy v2.4 Manual

    Additionally, np.einsum('ij,jk', a, b) returns a matrix multiplication, while, np.einsum('ij,jh', a, b) returns the transpose of the multiplication since subscript ‘h’ precedes subscript ‘i’.