DOC: minor alignment fixes to pandas.melt() docstring
#63869
+9
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pandas version checks
mainhereLocation 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 columnAwith valuesa, b, c, the printed example in the docstring visually appeared to have values0, 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.