Skip to content

BUG: alignment changing index on input series #36503

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
merged 8 commits into from
Sep 25, 2020

Conversation

jbrockmendel
Copy link
Member

@@ -8835,6 +8839,10 @@ def _align_series(
if is_datetime64tz_dtype(left.index.dtype):
if left.index.tz != right.index.tz:
if join_index is not None:
# GH#33671 ensure we don't change the index on
# our original Series
left = left.copy(deep=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to deep copy, just .copy() as that copies the data; here we just need to avoid mutating the index, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt that what deep=False means?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh woa, yes, i would remove the param then, its confusing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you can remove here and above the deep keyword

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i prefer to be explicit about this being non-deep

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer to just use copy, this is not the pattern we use; your comment is explanatory.

@jreback jreback added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Sep 21, 2020
@jreback
Copy link
Contributor

jreback commented Sep 21, 2020

also i think this needs a whatsnew bug fix reshaping note

@jreback jreback added the Bug label Sep 21, 2020
@jbrockmendel
Copy link
Member Author

whatsnew added + green

@@ -8835,6 +8839,10 @@ def _align_series(
if is_datetime64tz_dtype(left.index.dtype):
if left.index.tz != right.index.tz:
if join_index is not None:
# GH#33671 ensure we don't change the index on
# our original Series
left = left.copy(deep=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you can remove here and above the deep keyword

@@ -8835,6 +8839,10 @@ def _align_series(
if is_datetime64tz_dtype(left.index.dtype):
if left.index.tz != right.index.tz:
if join_index is not None:
# GH#33671 ensure we don't change the index on
# our original Series
left = left.copy(deep=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer to just use copy, this is not the pattern we use; your comment is explanatory.

@jbrockmendel
Copy link
Member Author

updated + greenasitgets

@jreback jreback added this to the 1.2 milestone Sep 25, 2020
@jreback jreback merged commit 40d3b5f into pandas-dev:master Sep 25, 2020
@jbrockmendel jbrockmendel deleted the bug-33671 branch September 25, 2020 00:33
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
* BUG: alignment changing index on input series

* whatsnew

* remove deep=False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Multiplication of two serieses changes the the timezone from the given serieses
2 participants