@@ -3485,6 +3485,77 @@ def dot(self, other):
34853485 The dot method for Series computes the inner product, instead of the
34863486 matrix product here.
34873487
3488+ **Examples:**
3489+
3490+ >>> import bigframes.pandas as bpd
3491+ >>> bpd.options.display.progress_bar = None
3492+
3493+ >>> left = bpd.DataFrame([[0, 1, -2, -1], [1, 1, 1, 1]])
3494+ >>> left
3495+ 0 1 2 3
3496+ 0 0 1 -2 -1
3497+ 1 1 1 1 1
3498+ <BLANKLINE>
3499+ [2 rows x 4 columns]
3500+ >>> right = bpd.DataFrame([[0, 1], [1, 2], [-1, -1], [2, 0]])
3501+ >>> right
3502+ 0 1
3503+ 0 0 1
3504+ 1 1 2
3505+ 2 -1 -1
3506+ 3 2 0
3507+ <BLANKLINE>
3508+ [4 rows x 2 columns]
3509+ >>> left.dot(right)
3510+ 0 1
3511+ 0 1 4
3512+ 1 2 2
3513+ <BLANKLINE>
3514+ [2 rows x 2 columns]
3515+
3516+ You can also use the operator ``@`` for the dot product:
3517+
3518+ >>> left @ right
3519+ 0 1
3520+ 0 1 4
3521+ 1 2 2
3522+ <BLANKLINE>
3523+ [2 rows x 2 columns]
3524+
3525+ The right input can be a Series, in which case the result will also be a
3526+ Series:
3527+
3528+ >>> right = bpd.Series([1, 2, -1,0])
3529+ >>> left @ right
3530+ 0 4
3531+ 1 2
3532+ dtype: Int64
3533+
3534+ Any user defined index of the left matrix and columns of the right
3535+ matrix will reflect in the result.
3536+
3537+ >>> left = bpd.DataFrame([[1, 2, 3], [2, 5, 7]], index=["alpha", "beta"])
3538+ >>> left
3539+ 0 1 2
3540+ alpha 1 2 3
3541+ beta 2 5 7
3542+ <BLANKLINE>
3543+ [2 rows x 3 columns]
3544+ >>> right = bpd.DataFrame([[2, 4, 8], [1, 5, 10], [3, 6, 9]], columns=["red", "green", "blue"])
3545+ >>> right
3546+ red green blue
3547+ 0 2 4 8
3548+ 1 1 5 10
3549+ 2 3 6 9
3550+ <BLANKLINE>
3551+ [3 rows x 3 columns]
3552+ >>> left.dot(right)
3553+ red green blue
3554+ alpha 13 32 55
3555+ beta 30 75 129
3556+ <BLANKLINE>
3557+ [2 rows x 3 columns]
3558+
34883559 Args:
34893560 other (Series or DataFrame):
34903561 The other object to compute the matrix product with.
0 commit comments