Navigation

  • index
  • modules |
  • modules |
  • next |
  • previous |
  • pandas 0.12.0.dev-13e18c9 documentation »
  • API Reference »

Table Of Contents

  • What’s New
  • Installation
  • Frequently Asked Questions (FAQ)
  • Package overview
  • 10 Minutes to Pandas
  • Cookbook
  • Intro to Data Structures
  • Essential Basic Functionality
  • Indexing and Selecting Data
  • Computational tools
  • Working with missing data
  • Group By: split-apply-combine
  • Merge, join, and concatenate
  • Reshaping and Pivot Tables
  • Time Series / Date functionality
  • Plotting with matplotlib
  • Trellis plotting interface
  • IO Tools (Text, CSV, HDF5, ...)
  • Enhancing Performance
  • Sparse data structures
  • Caveats and Gotchas
  • rpy2 / R interface
  • Related Python libraries
  • Comparison with R / R libraries
  • API Reference
    • Input/Output
    • General functions
    • Series
      • Attributes and underlying data
      • Conversion / Constructors
      • Indexing, iteration
      • Binary operator functions
      • Function application, GroupBy
      • Computations / Descriptive Stats
      • Reindexing / Selection / Label manipulation
      • Missing data handling
      • Reshaping, sorting
      • Combining / joining / merging
      • Time series-related
      • Plotting
      • Serialization / IO / Conversion
    • DataFrame
    • Panel
  • Release Notes

Search

Enter search terms or a module, class or function name.

pandas.Series.unstack¶

Series.unstack(level=-1)¶

Unstack, a.k.a. pivot, Series with MultiIndex to produce DataFrame

Parameters :

level : int, string, or list of these, default last level

Level(s) to unstack, can pass level name

Returns :

unstacked : DataFrame

Examples

>>> s
one  a   1.
one  b   2.
two  a   3.
two  b   4.
>>> s.unstack(level=-1)
     a   b
one  1.  2.
two  3.  4.
>>> s.unstack(level=0)
   one  two
a  1.   2.
b  3.   4.

Navigation

  • index
  • modules |
  • modules |
  • next |
  • previous |
  • pandas 0.12.0.dev-13e18c9 documentation »
  • API Reference »
© Copyright 2008-2012, the pandas development team. Created using Sphinx 1.2b1.