Skip to content

Bug fix - rename dataframe reset index #46167

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 88 commits into from
Mar 29, 2022

Conversation

weikhor
Copy link
Contributor

@weikhor weikhor commented Feb 27, 2022

@pep8speaks
Copy link

pep8speaks commented Feb 27, 2022

Hello @weikhor! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-03-29 15:32:04 UTC

@weikhor weikhor changed the title Bug fix rename dataframe reset index Bug fix - rename dataframe reset index Feb 27, 2022
@weikhor
Copy link
Contributor Author

weikhor commented Mar 3, 2022

Hi I still working on this. That is a lot of other test cases failed from this code changes. I need more time. Thank

@jreback jreback added Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Mar 5, 2022
@weikhor weikhor requested a review from jreback March 9, 2022 13:53
chean.wei.khor added 3 commits March 22, 2022 23:20
@weikhor weikhor closed this Mar 22, 2022
@weikhor weikhor reopened this Mar 22, 2022
@weikhor
Copy link
Contributor Author

weikhor commented Mar 22, 2022

@jreback

Hi I try many rounds of failures. It keep showing this errors in pipeline Doc Build and Upload. sphinx documentation

WARNING: 
>>>-------------------------------------------------------------------------
looking for now-outdated files... none found
Exception in /home/runner/work/pandas/pandas/doc/source/user_guide/io.rst at block ending on line 1569
Specify :okexcept: as an option in the ipython:: block to suppress this message
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Input In [182], in <cell line: 1>()
----> 1 print(open("data/mindex_ex.csv").read())

FileNotFoundError: [Errno 2] No such file or directory: 'data/mindex_ex.csv'

<<<-------------------------------------------------------------------------
WARNING: 
>>>-------------------------------------------------------------------------
Exception in /home/runner/work/pandas/pandas/doc/source/user_guide/io.rst at block ending on line 1579
Specify :okexcept: as an option in the ipython:: block to suppress this message
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Input In [183], in <cell line: 1>()
----> 1 df = pd.read_csv("data/mindex_ex.csv", index_col=[0, 1])

The reason is get_default_index_names for object Index I created in pandas/core/indexes/base.py. I have not clue what cause this. It is the reason I do not include new function get_default_index_names I create in doc/source/whatsnew/v1.5.0.rst?

@weikhor weikhor requested a review from jreback March 23, 2022 12:01
tm.assert_series_equal(result["first"], expected["new_first"], check_names=False)
tm.assert_series_equal(result["second"], expected["new_second"], check_names=False)

with pytest.raises(
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 make a new test for the errors tests. add one that tests an Index with names = list-like

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have add test.

@weikhor weikhor requested a review from jreback March 29, 2022 15:31
@jreback jreback merged commit 3b163de into pandas-dev:main Mar 29, 2022
@jreback
Copy link
Contributor

jreback commented Mar 29, 2022

thanks @weikhor very nice!

@weikhor weikhor deleted the bug_fix_rename_dataframe_reset_index branch March 30, 2022 00:28
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
Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: name(s) argument for reset_index?
5 participants