BUG: multi-index to_native_types is not passing thru parameters by nbonnotte · Pull Request #11551 · pandas-dev/pandas (original) (raw)
Even when there is a third column 'c'
that stays outside the index, we still get an empty Float64Index
:
In [5]: pd.DataFrame({'a': np.NaN, 'b':[2,3], 'c' : [5,6]}).set_index(['a','b']).index
Out[5]:
MultiIndex(levels=[[], [2, 3]],
labels=[[-1, -1], [0, 1]],
names=[u'a', u'b'])
In [6]: pd.DataFrame({'a': np.NaN, 'b':[2,3], 'c' : [5,6]}).set_index('a').index
Out[6]: Float64Index([nan, nan], dtype='float64', name=u'a')
If this is an "edge case", I'm pushing what I have done so far:
- what's new
- a short explanation for the test for
date_format
- add
names=self.names
where it should be - test if
quoting
is also passed to the multi-indexes
What I have NOT done:
- test if
decimal
,float_format
(issue DataFrame.to_csv ignores some formatting parameters for float indexes #11553), andna_rep
are passed