Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 492 Bytes

Reshaping.md

File metadata and controls

15 lines (9 loc) · 492 Bytes

Reshaping

  • Changing the structure of DataFrame to represent data in desired form.

Stack and Unstack

DataFrame.stack() : Represents a taller DataFrame.

  • Stacking increases the height of data frame.
  • stack() method helps us to move the columns into row values.

DataFrame.unstack() : Represents a wider DataFrame.

  • Unstacking decreases the height of data frame.
  • unstack() method helps us to move the row values to seperate columns.