Skip to content

Conversation

@chris-b1
Copy link
Contributor

@chris-b1 chris-b1 commented Jan 1, 2017

assert_frame_equal(result, expected)

result = df.copy()
result.rename(columns=['J', 'K'], index=['a', 'b'], inplace=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

test with ndarray and with an Index
a scalar should error yes?

@codecov-io
Copy link

codecov-io commented Jan 1, 2017

Current coverage is 84.77% (diff: 100%)

Merging #15029 into master will increase coverage by <.01%

@@ master #15029 diff @@ ========================================== Files 145 145 Lines 51131 51133 +2 Methods 0 0 Messages 0 0 Branches 0 0 ========================================== + Hits 43345 43348 +3  + Misses 7786 7785 -1  Partials 0 0 

Powered by Codecov. Last update 3662413...5e3848c

@jreback
Copy link
Contributor

jreback commented Jan 1, 2017

this is also now an alternative to the .index = API (which is fine I think). So can you put some references in the doc-string and update the docs (where .set_index is).

@chris-b1
Copy link
Contributor Author

chris-b1 commented Jan 1, 2017

I added a couple doc references, but I might be missing something - wasn't sure if there is a canonical spot for the .index/.columns= api?

@jreback
Copy link
Contributor

jreback commented Jan 1, 2017

http://pandas.pydata.org/pandas-docs/stable/indexing.html#set-reset-index

ad-hoc indexing. This would be expanded in any event (and maybe moved to http://pandas.pydata.org/pandas-docs/stable/basics.html#renaming-mapping-labels) as these are the same idea.

@jreback jreback added API Design Indexing Related to indexing on series/frames, not to indexes themselves labels Jan 1, 2017
@chris-b1 chris-b1 mentioned this pull request Jan 11, 2017
4 tasks
@chris-b1
Copy link
Contributor Author

Closing in favor of #15104

@chris-b1 chris-b1 closed this Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Design Indexing Related to indexing on series/frames, not to indexes themselves

3 participants