NaT in MultiIndex throws ValueError when reset_index() is called. (original) (raw)

Please see this test case:

x = pp.DataFrame({
    'other': ['a', np.nan],
    'date': ['2015-03-22', np.nan],
    'amount': [2, 3]
  })
x.date = pp.to_datetime(x.date)
index amount date other
0 2 2015-03-22 a
1 3 NaT NaN

The reset_index here then fails with the error below:

x.set_index(['other', 'date']).reset_index()

ValueError: Converting an integer to a NumPy datetime requires a specified unit

pp.version.version
'0.16.1'
pp.np.version.version
'1.7.1'