Compute the dot product between the Series and the columns of other.
This method computes the dot product between the Series and another one, or the Series and each columns of a DataFrame, or the Series and each columns of an array.
It can also be called using self @ other in Python >= 3.5.
Return the dot product of the Series and other if other is a Series, the Series of the dot product of Series and each rows of other if other is a DataFrame or a numpy.ndarray between the Series and each columns of the numpy array.
- Return type
The Series and other has to share the same index if other is a Series or a DataFrame.
>>> import mars.tensor as mt >>> import mars.dataframe as md >>> s = md.Series([0, 1, 2, 3]) >>> other = md.Series([-1, 2, -3, 4]) >>> s.dot(other).execute() 8 >>> (s @ other).execute() 8 >>> df = md.DataFrame([[0, 1], [-2, 3], [4, -5], [6, 7]]) >>> s.dot(df).execute() 0 24 1 14 dtype: int64 >>> arr = mt.array([[0, 1], [-2, 3], [4, -5], [6, 7]]) >>> s.dot(arr).execute() array([24, 14])