Panelnd
State: closed

## Panel4D

( note - this superseeds the prior branch, FDPanel and this is 0.9rc1 compatible)

Panel4D is like a Panel object, but provides 4 dimensions
  labels, items, major_axis, minor_axis

instead of using a dict of Panels to hold data, the Panel4D provides a convenient represenation in pandas space with named dimensions to allow easy axis swapping and slicing
# testing

tests/test_panel4d.py provides a similar methodology to test_panel.py

Panel4D required an overhall of many methods in panel.py and one change in core/index.py (regarding multi-indexing)
 almost all methods in a Panel are extended to Panel4D (with the exception in that Panel 
now allows a multi-axis on axis 0)

docstrings need to be refreshed a bit and made a bit more general

all tests that are not skipped pass (tested with 0.9rc1)

join is a work in progress
# further

panelnd.py provides a factory function for creation of generic panel-like ND structures with custom named dimensions
      (this works, but not fully tested - examples are in the docstring)


Labels:

Comments:
Merged this-- we'll mark it experimental in the release so there's no major expectation of API stability for the time being-- there were a few `644->755` file mode switches I had to fix

awesome! in that case will write up some docs prob tomorrow...separate PR? or just push to this one?

separate PR would be great!

will do....

btw...assume you are working on this...but just pulled from master:

```
[sheep-jreback-~/pandas] python setup.py build_ext --inplace
running build_ext
skipping 'pandas/index.c' Cython extension (up-to-date)
cythoning pandas/tslib.pyx to pandas/tslib.c

Error compiling Cython file:
------------------------------------------------------------
...

cdef PyTypeObject* ts_type = <PyTypeObject*> Timestamp


cdef inline bint is_timestamp(object o):
    return Py_TYPE(o) == ts_type # isinstance(o, Timestamp)
                 ^
------------------------------------------------------------

pandas/tslib.pyx:516:18: undeclared name not builtin: Py_TYPE

Error compiling Cython file:
------------------------------------------------------------
...

cdef PyTypeObject* ts_type = <PyTypeObject*> Timestamp


cdef inline bint is_timestamp(object o):
    return Py_TYPE(o) == ts_type # isinstance(o, Timestamp)
                     ^
------------------------------------------------------------

pandas/tslib.pyx:516:22: Invalid types for '==' (Python object, PyTypeObject *)
building 'pandas.tslib' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/lib/python2.7/site-packages/numpy/core/include -Ipandas/src/klib -Ipandas/src -I/usr/local/include/python2.7 -c pandas/tslib.c -o build/temp.linux-x86_64-2.7/pandas/tslib.o
pandas/tslib.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
```

What version of Cython? Working OK with 0.17.2

was on 0.16...updated to 0.17.2 and worked great! (I think this never came up before because the files are already cythonized....in master)..

getting failure on: test_to_excel (in tests/test_panel.py).....? (the read pack frame's index is not matching...looks like it is a list of numbers rather than a DatetimeIndex)

You may have to upgrade your openpyxl install

that fixed it.....maybe should list dependcy versions somewhere?

Yeah. I'll make an issue to update the docs/readme.rst