diff --git a/doc/source/_static/reshaping_melt.png b/doc/source/_static/reshaping_melt.png index d0c4e77655e60..26daff22640b7 100644 Binary files a/doc/source/_static/reshaping_melt.png and b/doc/source/_static/reshaping_melt.png differ diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index f118fe84d523a..6d61523302f08 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -292,11 +292,11 @@ For instance, cheese = pd.DataFrame({'first': ['John', 'Mary'], 'last': ['Doe', 'Bo'], - 'height': [5.5, 6.0], - 'weight': [130, 150]}) + 'A': [5.5, 6.0], + 'B': [7, 9]}) cheese cheese.melt(id_vars=['first', 'last']) - cheese.melt(id_vars=['first', 'last'], var_name='quantity') + cheese.melt(id_vars=['first', 'last'], var_name='treatment') Another way to transform is to use the :func:`~pandas.wide_to_long` panel data convenience function. It is less flexible than :func:`~pandas.melt`, but more