New unified merge function for efficiently performing
full gamut of database / relational-algebra operations. Refactored existing
join methods to use the new infrastructure, resulting in substantial
performance gains (GH 220, GH 249, GH 267)
New unified concatenation function for concatenating
Series, DataFrame or Panel objects along an axis. Can form union or
intersection of the other axes. Improves performance of Series.append and
DataFrame.append (GH 468, , )
One of the potentially riskiest API changes in 0.7.0, but also one of the most
important, was a complete review of how integer indexes are handled with
regard to label-based indexing. Here is an example:
This is all exactly identical to the behavior before. However, if you ask for a
key not contained in the Series, in versions 0.6.1 and prior, Series would
fall back on a location-based lookup. This now raises a KeyError:
In [2]: s[1]KeyError: 1
This change also has the same impact on DataFrame:
As as notational convenience, you can pass a sequence of labels or a label
slice to a Series when getting and setting values via [] (i.e. the
__getitem__ and __setitem__ methods). The behavior will be the same as
passing similar input to ixexcept in the case of integer indexing:
In the case of integer indexes, the behavior will be exactly as before
(shadowing ndarray):
In [13]: s=pd.Series(np.random.randn(6),index=range(0,12,2))In [14]: s[[4,0,2]]Out[14]:4 0.1320030 0.4108352 0.813850
If you wish to do indexing with sequences and slicing on an integer index with
label semantics, use ix.
Other API changes
The deprecated LongPanel class has been completely removed
If Series.sort is called on a column of a DataFrame, an exception will
now be raised. Before it was possible to accidentally mutate a DataFrame’s
column by doing df[col].sort() instead of the side-effect free method
df[col].order() (GH 316)
Miscellaneous renames and deprecations which will (harmlessly) raise
FutureWarning
drop added as an optional parameter to DataFrame.reset_index (GH 699)
Performance improvements
Cythonized GroupBy aggregations no longer
presort the data, thus achieving a significant speedup (GH 93). GroupBy
aggregations with Python functions significantly sped up by clever
manipulation of the ndarray data type in Cython (GH 496).
Better error message in DataFrame constructor when passed column labels
don’t match data (GH 497)
Substantially improve performance of multi-GroupBy aggregation when a
Python function is passed, reuse ndarray object in Cython (GH 496)
Can store objects indexed by tuples and floats in HDFStore (GH 492)
Don’t print length by default in Series.to_string, add length option (GH 489)
Improve Cython code for multi-groupby to aggregate without having to sort
the data (GH 93)
Improve MultiIndex reindexing speed by storing tuples in the MultiIndex,
test for backwards unpickling compatibility
Improve column reindexing performance by using specialized Cython take
function
Further performance tweaking of Series.__getitem__ for standard use cases
Avoid Index dict creation in some cases (i.e. when getting slices, etc.),
regression from prior versions
Friendlier error message in setup.py if NumPy not installed
Use common set of NA-handling operations (sum, mean, etc.) in Panel class
also (GH 536)
Default name assignment when calling reset_index on DataFrame with a
regular (non-hierarchical) index (GH 476)
Use Cythonized groupers when possible in Series/DataFrame stat ops with
level parameter passed (GH 545)
Ported skiplist data structure to C to speed up rolling_median by about
5-10x in most typical use cases (GH 374)
Contributors
A total of 18 people contributed patches to this release. People with a
“+” by their names contributed a patch for the first time.