Reshape DataFrames

To reshape DataFrames

  1. 1.
    Click on the Reshape app.
  2. 2.
    Select DataFrame to reshape.
  3. 3.
    Select the method:
  • Pivot: to transform the data from long to wide.
  • Melt: to transform the data from wide to long.

Pivot

  1. 1.
    Select a column to use to make new DataFrame's index. If not specified, it uses existing index.
  2. 2.
    Select a column to use to make new DataFrame's columns.
  3. 3.
    Select column(s) to use for populating new DataFrame's values. If not specified, it uses all columns.
  4. 4.
    and click Run !
Melt
  1. 1.
    Select column(s) to use as identifier variables.
  2. 2.
    Select column(s) to unpivot. If not specified, it uses all columns.
  3. 3.
    Assign to a new variable.
  4. 4.
    and, click Run !
Copy link
On this page
To reshape DataFrames