|
48 | 48 | from pandas._libs.lib import no_default
|
49 | 49 | from pandas._typing import (
|
50 | 50 | AggFuncType,
|
| 51 | + AnyArrayLike, |
51 | 52 | ArrayLike,
|
52 | 53 | Axes,
|
53 | 54 | Axis,
|
@@ -1141,7 +1142,17 @@ def __len__(self) -> int:
|
1141 | 1142 | """
|
1142 | 1143 | return len(self.index)
|
1143 | 1144 |
|
1144 |
| - def dot(self, other): |
| 1145 | + # pandas/core/frame.py:1146: error: Overloaded function signatures 1 and 2 |
| 1146 | + # overlap with incompatible return types [misc] |
| 1147 | + @overload |
| 1148 | + def dot(self, other: Series) -> Series: # type: ignore[misc] |
| 1149 | + ... |
| 1150 | + |
| 1151 | + @overload |
| 1152 | + def dot(self, other: Union[DataFrame, Index, ArrayLike]) -> DataFrame: |
| 1153 | + ... |
| 1154 | + |
| 1155 | + def dot(self, other: Union[AnyArrayLike, FrameOrSeriesUnion]) -> FrameOrSeriesUnion: |
1145 | 1156 | """
|
1146 | 1157 | Compute the matrix multiplication between the DataFrame and other.
|
1147 | 1158 |
|
@@ -1251,7 +1262,19 @@ def dot(self, other):
|
1251 | 1262 | else: # pragma: no cover
|
1252 | 1263 | raise TypeError(f"unsupported type: {type(other)}")
|
1253 | 1264 |
|
1254 |
| - def __matmul__(self, other): |
| 1265 | + @overload |
| 1266 | + def __matmul__(self, other: Series) -> Series: |
| 1267 | + ... |
| 1268 | + |
| 1269 | + @overload |
| 1270 | + def __matmul__( |
| 1271 | + self, other: Union[AnyArrayLike, FrameOrSeriesUnion] |
| 1272 | + ) -> FrameOrSeriesUnion: |
| 1273 | + ... |
| 1274 | + |
| 1275 | + def __matmul__( |
| 1276 | + self, other: Union[AnyArrayLike, FrameOrSeriesUnion] |
| 1277 | + ) -> FrameOrSeriesUnion: |
1255 | 1278 | """
|
1256 | 1279 | Matrix multiplication using binary `@` operator in Python>=3.5.
|
1257 | 1280 | """
|
|
0 commit comments