Skip to content

Conversation

@DrDougPhD
Copy link

@DrDougPhD DrDougPhD commented Jan 25, 2026

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.melt.html

Documentation problem

Dataframe headers that appear in the example docstring for pandas.melt() were not properly aligned with their columns. This caused some initial confusion, as the columns in the constructed dataframe example did not visually appear to match the columns in the example output. While the constructed dataframe has column A with values a, b, c, the printed example in the docstring visually appeared to have values 0, 1, 2. This similarly applies to all of the other columns.

Suggested fix for documentation

Adding additional spaces to the headers in the docstring fixes the appearance. It now appears to match what is displayed when re-running the examples in an interpreter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant