Skip to content

Latest commit

 

History

History
161 lines (79 loc) · 2.87 KB

pandas-shape.md

File metadata and controls

161 lines (79 loc) · 2.87 KB

Pandas 3: Shaping data


Overview.

Python tools.

Buzzwords.

Applications.

Code. Link.


FOLDED INTO PREVIOUS CHAPTER

Reminders

DataFrames: index, columns

Want operator

Chipotle
Yahoo finance: Ju's example, reshape
World Bank data

Setting the index

Multi-indexes

  • WEO
  • Yahoo finance

Stacking and unstacking

stack... (Rhodes 1:34)

unstack: Brandon Rhodes at 2:00

Pivot

Panel data

Diff structure for multi-index...

Suggestion: use the to_frame method to convert to a multi-indexed dataframe

Here's an example from a student, who was downloading stock prices. Here we download daily stock prices for Apple and Google.

References

Brandon Rhodes. This is great.
https://youtu.be/5JnMutdy6Fw https://github.com/brandon-rhodes/pycon-pandas-tutorial/