Skip to content

Latest commit

 

History

History
98 lines (68 loc) · 2.6 KB

cookbook.rst

File metadata and controls

98 lines (68 loc) · 2.6 KB
.. currentmodule:: pandas

.. ipython:: python
   :suppress:

   import numpy as np
   import random
   import os
   np.random.seed(123456)
   from pandas import *
   import pandas as pd
   randn = np.random.randn
   randint = np.random.randint
   np.set_printoptions(precision=4, suppress=True)

Cookbook

This is a respository for short and sweet example and links for useful pandas recipes. We encourage users to add to this documentation. This is a great First Pull Request.

Selection

Boolean Rows Indexing

Extending a panel along the minor axis

Using loc and iloc in selections

MultiIndexing

Prepending a level to a multiindex

Slicing a multi-index with xs

Multi-index sorting

Partial Selection, the need for sortedness

Grouping

Basic grouping with apply

Apply to different items in a group

Replacing values with groupby means

TimeGrouping of values grouped across time

Merge

Join

Joining a DataFrame to itself

Timeseries

Resample intraday frame without adding new days

Data In/Out

CSV

HDF5

Managing heteregenous data using a linked multiple table hierarchy

Simple Queries with a Timestamp Index

Miscellaneous