29.03.2014 Views

Data structures for statistical computing in Python - SciPy Conferences

Data structures for statistical computing in Python - SciPy Conferences

Data structures for statistical computing in Python - SciPy Conferences

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Manipulat<strong>in</strong>g panel (3D) data<br />

What you saw was the “stacked” or tabular <strong>for</strong>mat, but the 3D <strong>for</strong>m can<br />

be more useful at times:<br />

>>> lp = LongPanel.fromRecords(grunfeld, ’year’,<br />

’firm’)<br />

>>> wp = lp.toWide()<br />

>>> wp<br />

<br />

Dimensions: 3 (items) x 20 (major) x 10 (m<strong>in</strong>or)<br />

Items: capital to value<br />

Major axis: 1935 to 1954<br />

M<strong>in</strong>or axis: 1 to 10<br />

McK<strong>in</strong>ney () Statistical <strong>Data</strong> Structures <strong>in</strong> <strong>Python</strong> <strong>SciPy</strong> 2010 27 / 31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!