Skip to content

Conversation

@allamlobna
Copy link
Contributor

@allamlobna allamlobna commented Oct 10, 2025

Summary

This PR fixes an inconsistency where read_csv replaced empty
MultiIndex column level values with automatically generated
"Unnamed: x_level_y" placeholders.

Empty values are now preserved as empty strings (""),
matching MultiIndex index behavior and ensuring consistent
roundtrip results between to_csv and read_csv.

Changes

  • Added _clean_column_levels() helper to normalize MultiIndex
    column labels in BaseParser.
  • Updated _extract_multi_indexer_columns() to use it.
  • Adjusted test_multi_index_unnamed() expectations.
  • Added regression test for GH#59560 in test_header.py.
  • Added whatsnew entry under Bug Fixes → IO.

Impact

  • Aligns column + index behavior for MultiIndex CSVs.
  • No change for single-level headers.
  • Both C and Python parsers tested successfully.
@allamlobna allamlobna force-pushed the bugfix/clean-empty-vals-multiindex branch from 6a40ca3 to a399a8e Compare October 10, 2025 19:08
@allamlobna

This comment was marked as outdated.

@allamlobna allamlobna marked this pull request as draft October 10, 2025 20:09
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant