Skip to content

Commit

Permalink
add regression test to cover an issue pandas-dev#38147
Browse files Browse the repository at this point in the history
  • Loading branch information
vagechirkov committed Apr 18, 2023
1 parent 11d75d8 commit 873ce08
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pandas/tests/frame/methods/test_reset_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,3 +773,14 @@ def test_errorreset_index_rename(float_frame):

with pytest.raises(IndexError, match="list index out of range"):
stacked_df.reset_index(names=["new_first"])


def test_reset_index_false_index_name():
# GH 38147
df1 = Series(data=range(5, 10), index=range(0, 5))
df1.index.name = False
df1.reset_index()

df2 = DataFrame(data=range(5, 10), index=range(0, 5))
df2.index.name = False
df2.reset_index()

0 comments on commit 873ce08

Please sign in to comment.