pandas 1.4.2

NotesParametersReturnsBackRef
dot(self, 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 :None:None:`self @ other` in Python >= 3.5.

Notes

The Series and other has to share the same index if other is a Series or a DataFrame.

Parameters

other : Series, DataFrame or array-like

The other object to compute the dot product with its columns.

Returns

scalar, Series or numpy.ndarray

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.

Compute the dot product between the Series and the columns of other.

See Also

DataFrame.dot

Compute the matrix product with the DataFrame.

Series.mul

Multiplication of series and other, element-wise.

Examples

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series([0, 1, 2, 3])
... other = pd.Series([-1, 2, -3, 4])
... s.dot(other) 8
This example is valid syntax, but we were not able to check execution
>>> s @ other
8
This example is valid syntax, but we were not able to check execution
>>> df = pd.DataFrame([[0, 1], [-2, 3], [4, -5], [6, 7]])
... s.dot(df) 0 24 1 14 dtype: int64
This example is valid syntax, but we were not able to check execution
>>> arr = np.array([[0, 1], [-2, 3], [4, -5], [6, 7]])
... s.dot(arr) array([24, 14])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.frame.DataFrame.dot

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/series.py#2747
type: <class 'function'>
Commit: