-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: Replace FrameOrSeriesUnion annotation by DataFrame | Series #41955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
simonjayhawkins
merged 11 commits into
pandas-dev:master
from
Swanand01:remove-frame-or-series-check
Jul 4, 2021
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7e0bda3
CLN: Replace FrameOrSeriesUnion annotation by DataFrame | Series
Swanand01 896b29a
Merge remote-tracking branch 'upstream/master' into remove-frame-or-s…
Swanand01 6bbe77e
Import fixes
Swanand01 1d610ca
Update ewm.py
Swanand01 8bee21f
Revert "Update ewm.py"
Swanand01 76d0dbf
Revert "Import fixes"
Swanand01 8ffca34
Circular imports fix
Swanand01 7e06259
Update timeseries.py
Swanand01 dc70410
Update rolling.py
Swanand01 53acbbf
Update timeseries.py
Swanand01 28bd825
Update style_render.py
Swanand01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,6 @@ | |
FillnaOptions, | ||
FloatFormatType, | ||
FormattersType, | ||
FrameOrSeriesUnion, | ||
Frequency, | ||
IndexKeyFunc, | ||
IndexLabel, | ||
|
@@ -1362,7 +1361,7 @@ def dot(self, other: Series) -> Series: | |
def dot(self, other: DataFrame | Index | ArrayLike) -> DataFrame: | ||
... | ||
|
||
def dot(self, other: AnyArrayLike | FrameOrSeriesUnion) -> FrameOrSeriesUnion: | ||
def dot(self, other: AnyArrayLike | DataFrame | Series) -> DataFrame | Series: | ||
""" | ||
Compute the matrix multiplication between the DataFrame and other. | ||
|
||
|
@@ -1478,13 +1477,13 @@ def __matmul__(self, other: Series) -> Series: | |
|
||
@overload | ||
def __matmul__( | ||
self, other: AnyArrayLike | FrameOrSeriesUnion | ||
) -> FrameOrSeriesUnion: | ||
self, other: AnyArrayLike | DataFrame | Series | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same (and already included in previous overload anyway) |
||
) -> DataFrame | Series: | ||
... | ||
|
||
def __matmul__( | ||
self, other: AnyArrayLike | FrameOrSeriesUnion | ||
) -> FrameOrSeriesUnion: | ||
self, other: AnyArrayLike | DataFrame | Series | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
) -> DataFrame | Series: | ||
""" | ||
Matrix multiplication using binary `@` operator in Python>=3.5. | ||
""" | ||
|
@@ -8401,8 +8400,8 @@ def _gotitem( | |
self, | ||
key: IndexLabel, | ||
ndim: int, | ||
subset: FrameOrSeriesUnion | None = None, | ||
) -> FrameOrSeriesUnion: | ||
subset: DataFrame | Series | None = None, | ||
) -> DataFrame | Series: | ||
""" | ||
Sub-classes to define. Return a sliced object. | ||
|
||
|
@@ -8931,7 +8930,7 @@ def append( | |
|
||
def join( | ||
self, | ||
other: FrameOrSeriesUnion, | ||
other: DataFrame | Series, | ||
on: IndexLabel | None = None, | ||
how: str = "left", | ||
lsuffix: str = "", | ||
|
@@ -9061,7 +9060,7 @@ def join( | |
|
||
def _join_compat( | ||
self, | ||
other: FrameOrSeriesUnion, | ||
other: DataFrame | Series, | ||
on: IndexLabel | None = None, | ||
how: str = "left", | ||
lsuffix: str = "", | ||
|
@@ -9131,7 +9130,7 @@ def _join_compat( | |
@Appender(_merge_doc, indents=2) | ||
def merge( | ||
self, | ||
right: FrameOrSeriesUnion, | ||
right: DataFrame | Series, | ||
how: str = "inner", | ||
on: IndexLabel | None = None, | ||
left_on: IndexLabel | None = None, | ||
|
@@ -10724,7 +10723,7 @@ def _from_nested_dict(data) -> collections.defaultdict: | |
return new_data | ||
|
||
|
||
def _reindex_for_setitem(value: FrameOrSeriesUnion, index: Index) -> ArrayLike: | ||
def _reindex_for_setitem(value: DataFrame | Series, index: Index) -> ArrayLike: | ||
# reindex if necessary | ||
|
||
if value.index.equals(index) or not len(index): | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Series is also AnyArrayLike
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh, we should add a check for this
EDIT
#42359
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. we can merge this and let the check fix this