10 Minutes to pandas

This is a short introduction to pandas, geared mainly for new users. You can see more complex recipes in the Cookbook Customarily, we import as follows: In [1]: import pandas as pd In [2]: import numpy as np In [3]: import matplotlib.pyplot as plt Object Creation See the Data Structure Intro section Creating a Series by passing a list of values, letting pandas create a default integer index: In [4]: s = pd.Series([1,3,5,np.nan,6,8]) In [5]: s Out[5]: 0 1.0 1 3.0 2 5.0 3 NaN 4

DatetimeIndex.values

DatetimeIndex.values return the underlying data as an ndarray

Series.str.len()

Series.str.len() [source] Compute length of each string in the Series/Index. Returns: lengths : Series/Index of integer values

MultiIndex.T

MultiIndex.T return the transpose, which is by definition self

Series.put()

Series.put(*args, **kwargs) [source] Applies the put method to its values attribute if it has one. See also numpy.ndarray.put

MultiIndex.item()

MultiIndex.item() [source] return the first element of the underlying data as a python scalar

DataFrame.iget_value()

DataFrame.iget_value(i, j) [source] DEPRECATED. Use .iat[i, j] instead

MultiIndex.reorder_levels()

MultiIndex.reorder_levels(order) [source] Rearrange levels using input order. May not drop or duplicate levels

Comparison with SAS

For potential users coming from SAS this page is meant to demonstrate how different SAS operations would be performed in pandas. If you?re new to pandas, you might want to first read through 10 Minutes to pandas to familiarize yourself with the library. As is customary, we import pandas and numpy as follows: In [1]: import pandas as pd In [2]: import numpy as np Note Throughout this tutorial, the pandas DataFrame will be displayed by calling df.head(), which displays the first N (default 5)

Tutorials

This is a guide to many pandas tutorials, geared mainly for new users. Internal Guides pandas own 10 Minutes to pandas More complex recipes are in the Cookbook pandas Cookbook The goal of this cookbook (by Julia Evans) is to give you some concrete examples for getting started with pandas. These are examples with real-world data, and all the bugs and weirdness that that entails. Here are links to the v0.1 release. For an up-to-date table of contents, see the pandas-cookbook GitHub repository