modin icon indicating copy to clipboard operation
modin copied to clipboard

reset_index(inplace=True) creates column with the name `index` instead of original

Open izdi opened this issue 7 years ago • 2 comments

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS Mojave 10.14.3 (18D109)
  • Modin installed from (source or binary): pip
  • Modin version: 0.4.0
  • Python version: 3.7.0
  • Exact command to reproduce: test_data.reset_index(inplace=True)

Describe the problem

reset_index(inplace=True) creates column with the name index instead of original

Source code / logs

Actual (Modin)

import modin.pandas as pd
import numpy as np

test_data = pd.DataFrame({
    'A': 1,
    'B': np.array([3] * 4, dtype='int32')
})
test_data.set_index('A', inplace=True)
test_data.reset_index(inplace=True)
test_data

Out[1]:
   index  B
0      1  3
1      1  3
2      1  3
3      1  3

Expected (Pandas)

import numpy as np
import pandas as pd

test_data_a = pd.DataFrame({
    'A': 1,
    'B': np.array([3] * 4, dtype='int32')
})
test_data_a.set_index('A', inplace=True)
test_data_a.reset_index(inplace=True)
test_data_a

Out[2]:
   A  B
0  1  3
1  1  3
2  1  3
3  1  3

izdi avatar Apr 24 '19 19:04 izdi

Thanks @izdi, this was fixed in #553, and will be included in the next release. We are planning to release today or tomorrow depending on fixing a couple of bugs.

Thanks again for the report!

devin-petersohn avatar Apr 24 '19 19:04 devin-petersohn

Fixed by #553

devin-petersohn avatar May 22 '19 21:05 devin-petersohn