pydata/pandas — pull request #2915 by jreback (2013-02-22 19:27:53+00:00)
Title: CLN: refactor of frame.py/panel.py to move common code to generic.py

- Refactor of frame.py/panel.py to move common code to generic.py
all axis creation and manipulation code is now common (except for Series)

- added _setup_axes to create generic NDFrame structures
- moved methods (some methods moved from series as well)

- from_axes,_wrap_array,axes,ix,shape,empty,swapaxes,transpose,pop
- __str__,__bytes__,__repr__
- __iter__,keys,__contains__,__len__,__neg__,__invert__
- convert_objects,as_blocks,as_matrix,values
- __getstate__,__setstate__ (though compat remains in frame/panel)
- __getattr__,__setattr__
- _indexed_same,reindex_like,reindex,align,where,mask
- filter (added axis argument to selectively filter on a different axis)
- reindex : changed a fair amount
- truncate (moved to become part of PandasObject)

- API Changes in Panel which make Panel more consistent with DataFrame
- swapaxes on a Panel with the same axes specified now return a copy
- support attribute access for setting
- filter supports same api as original DataFrame filter

- API change in that reindex called with no arguments will now return a copy of the input object (e.g. ```df.reindex()```)

_performance is comparable to the existing codebase_

Reasoning for this change:
1. this is in preparation for a change in series to sub-class NDFrame, rather than ndarray directly, with proper support for BlockManager. _this will also theoretically allow a way to do ```integer NaNs```, via a mask in the IntBlock_
2. preparation for adding SparseBlocks to BlockManager
3. future changes/additions in indexing will be more straightforward, e.g. adding an integer like ```ix``` can be done, hopefully in one place
4. future API compatibiliy across objects (e.g. won't have to add methods to both Frame and Panel, and there API can be pretty consistent)