Skip to content

Commit f794ff6

Browse files
committed
update Series.dot docstring with DataFrame support
1 parent 594c587 commit f794ff6

File tree

1 file changed

+16
-7
lines changed
  • third_party/bigframes_vendored/pandas/core

1 file changed

+16
-7
lines changed

third_party/bigframes_vendored/pandas/core/series.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,7 @@ def dot(self, other) -> Series | np.ndarray:
620620
Compute the dot product between the Series and the columns of other.
621621
622622
This method computes the dot product between the Series and another
623-
one, or the Series and each columns of a DataFrame, or the Series and
624-
each columns of an array.
623+
one, or the Series and each columns of a DataFrame.
625624
626625
It can also be called using `self @ other` in Python >= 3.5.
627626
@@ -646,15 +645,25 @@ def dot(self, other) -> Series | np.ndarray:
646645
>>> s @ other
647646
8
648647
648+
The other operand can be a DataFrame:
649+
650+
>>> other = bpd.DataFrame({"a" : [-1, 2, -3, 4],
651+
... "b" : [-10, 20, -30, 40],
652+
... "c" : [-1, 2, -3, bpd.NA]})
653+
>>> s @ other
654+
a 8.0
655+
b 80.0
656+
c <NA>
657+
dtype: Float64
658+
649659
Args:
650-
other (Series):
660+
other (Series, or DataFrame):
651661
The other object to compute the dot product with its columns.
652662
653663
Returns:
654-
scalar, Series or numpy.ndarray: Return the dot product of the Series
655-
and other if other is a Series, the Series of the dot product of
656-
Series and each rows of other if other is a DataFrame or a
657-
numpy.ndarray between the Series and each columns of the numpy array.
664+
scalar, Series: Return the dot product of the Series
665+
and other if other is a Series, or the Series of the dot product
666+
of Series and each column of other if other is a DataFrame.
658667
659668
660669
"""

0 commit comments

Comments
 (0)