Skip to content

Conversation

@phofl
Copy link
Member

@phofl phofl commented Jan 25, 2022

@phofl phofl added Indexing Related to indexing on series/frames, not to indexes themselves Regression Functionality that used to work in a prior pandas version labels Jan 25, 2022
@phofl phofl added this to the 1.4.1 milestone Jan 25, 2022
df = value.to_frame().T
df.index = [indexer]
# error: "List[Any]" has no attribute "name"
df.index.name = self.obj.index.name # type: ignore[attr-defined]
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm this is actually modifying the indexer i think.

maybe
df.index = pd.Index([indexer], name=self.obj.index.name)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, changed

@jreback jreback merged commit 3aa2ed4 into pandas-dev:main Jan 26, 2022
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Jan 26, 2022
jreback pushed a commit that referenced this pull request Jan 27, 2022
…mpty before (#45650)

Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
@phofl phofl deleted the 45621 branch January 28, 2022 10:19
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Indexing Related to indexing on series/frames, not to indexes themselves Regression Functionality that used to work in a prior pandas version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: 1.4.0 does not preserve initially empty Index and appended by loc assignment.

2 participants