Skip to content
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

BUG: copying series into empty dataframe does not preserve dataframe index name #36141

Merged
merged 5 commits into from Sep 8, 2020

Conversation

Dr-Irv
Copy link
Contributor

@Dr-Irv Dr-Irv commented Sep 5, 2020

@Dr-Irv Dr-Irv added the Needs Review Waiting for review/response from a maintainer. label Sep 5, 2020

df["series"] = series

tm.assert_equal(df.index.name, "df_index")
Copy link
Contributor

Choose a reason for hiding this comment

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

can you construct the expected frame and use tm.assert_frame_equal

@jreback jreback added this to the 1.1.2 milestone Sep 5, 2020
@jreback jreback added Index Related to the Index class or subclasses Indexing Related to indexing on series/frames, not to indexes themselves and removed Needs Review Waiting for review/response from a maintainer. labels Sep 5, 2020
@jreback
Copy link
Contributor

jreback commented Sep 6, 2020

also pls merge master

@Dr-Irv Dr-Irv requested a review from jreback September 8, 2020 12:02
@jreback
Copy link
Contributor

jreback commented Sep 8, 2020

@simonjayhawkins ok for 1.1.2 (if you haven't tagged), otherwise let's push to 1.1.3

@simonjayhawkins
Copy link
Member

@simonjayhawkins ok for 1.1.2 (if you haven't tagged), otherwise let's push to 1.1.3

ok for 1.1.2

@simonjayhawkins simonjayhawkins merged commit 6d340a9 into pandas-dev:master Sep 8, 2020
@simonjayhawkins
Copy link
Member

Thanks @Dr-Irv

@simonjayhawkins
Copy link
Member

@meeseeksdev backport 1.1.x

2 similar comments
@simonjayhawkins
Copy link
Member

@meeseeksdev backport 1.1.x

@simonjayhawkins
Copy link
Member

@meeseeksdev backport 1.1.x

@lumberbot-app
Copy link

lumberbot-app bot commented Sep 8, 2020

Something went wrong ... Please have a look at my logs.

1 similar comment
@lumberbot-app
Copy link

lumberbot-app bot commented Sep 8, 2020

Something went wrong ... Please have a look at my logs.

simonjayhawkins pushed a commit that referenced this pull request Sep 8, 2020
… preserve dataframe index name (#36221)

Co-authored-by: Irv Lustig <irv@princeton.com>
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Sep 8, 2020
@Dr-Irv Dr-Irv deleted the issue31368 branch September 18, 2020 11:34
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Index Related to the Index class or subclasses Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index name assignment resolution logic changes depending on whether DataFrame has any rows
3 participants