Update dataframe_to_rows to fix uneven indices

Merged snippet requested to merge topic/3.1/issue_1904 into branch/3.1

This should resolve #1904 (closed) and #1908 (closed). The change to the test is just making the index uneven in size in case there's some future change to it.

Thanks to @xrcyz for the assistance debugging it. --HG-- branch : 3.1

Merge request reports