Skip to content

Commit

Permalink
DOC: Clarifying pandas.melt method documentation by replacing "massag…
Browse files Browse the repository at this point in the history
…e" by "reshape" (pandas-dev#60420)

Clarifying pandas.melt method documentation by replacing "massage" by "reshape"

Meanwhile, "massage" is correct in a colloquial sense to mean transforming or reshaping data. This is far from accessible for a non-English speaker (as I am).

Using the term `reshape` or `transform` is more meaningful while being accurate.
  • Loading branch information
ohe authored Nov 26, 2024
1 parent ab757ff commit be41966
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/source/user_guide/reshaping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ The missing value can be filled with a specific value with the ``fill_value`` ar
.. image:: ../_static/reshaping_melt.png

The top-level :func:`~pandas.melt` function and the corresponding :meth:`DataFrame.melt`
are useful to massage a :class:`DataFrame` into a format where one or more columns
are useful to reshape a :class:`DataFrame` into a format where one or more columns
are *identifier variables*, while all other columns, considered *measured
variables*, are "unpivoted" to the row axis, leaving just two non-identifier
columns, "variable" and "value". The names of those columns can be customized
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/reshape/melt.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def melt(
"""
Unpivot a DataFrame from wide to long format, optionally leaving identifiers set.
This function is useful to massage a DataFrame into a format where one
This function is useful to reshape a DataFrame into a format where one
or more columns are identifier variables (`id_vars`), while all other
columns, considered measured variables (`value_vars`), are "unpivoted" to
columns are considered measured variables (`value_vars`), and are "unpivoted" to
the row axis, leaving just two non-identifier columns, 'variable' and
'value'.
Expand Down

0 comments on commit be41966

Please sign in to comment.