Skip to content

Panelnd #2242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 2, 2012
Merged

Panelnd #2242

merged 4 commits into from
Dec 2, 2012

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Nov 14, 2012

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)

…ems, 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)
@wesm wesm merged commit da287b0 into pandas-dev:master Dec 2, 2012
@wesm
Copy link
Member

wesm commented Dec 2, 2012

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

@jreback
Copy link
Contributor Author

jreback commented Dec 2, 2012

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

@wesm
Copy link
Member

wesm commented Dec 2, 2012

separate PR would be great!

@jreback
Copy link
Contributor Author

jreback commented Dec 2, 2012

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

@wesm
Copy link
Member

wesm commented Dec 2, 2012

What version of Cython? Working OK with 0.17.2

@jreback
Copy link
Contributor Author

jreback commented Dec 3, 2012

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)..

@jreback
Copy link
Contributor Author

jreback commented Dec 3, 2012

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)

@wesm
Copy link
Member

wesm commented Dec 3, 2012

You may have to upgrade your openpyxl install

@jreback
Copy link
Contributor Author

jreback commented Dec 3, 2012

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

@wesm
Copy link
Member

wesm commented Dec 3, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants