dataframe_to_rows misses the level of multi-index
Name: openpyxl Version: 3.0.7
In []: df1 = pd.DataFrame({'a':[pd.NA, 'foo', 'one', pd.NA, 'one'],'b':['bar', 'yura', 'two', pd.NA, 'xuzzy']})
In []: df1
Out[]:
a b
0 <NA> bar
1 foo yura
2 one two
3 <NA> <NA>
4 one xuzzy
In []: df1.groupby(['a','b'], dropna=False).agg(count=('a', 'count'))
Out[]:
count
a b
foo yura 1
one two 1
xuzzy 1
NaN bar 0
NaN 0
In []: list(dataframe_to_rows(df1.groupby(['a','b'], dropna=False).agg(count=('a', 'count'))))
Out[]:
[[None, None, 'count'],
FrozenList(['a', 'b']),
['foo', 'yura', 1],
[None, 'two', 1],
[None, 'xuzzy', 1],
[None, 'bar', 0],
[None, nan, 0]]
As can be seen, "one" key in the first level of index is missing