[SciPy-user] Table like array

Andrew Straw strawman at astraw.com
Wed Mar 1 11:42:26 CST 2006


Dear Michael,

Here's something I wrote several years ago and which maybe you can use
as a starting point. It's certainly not the best code (and some of the
methods could clearly just be chopped as they were written for special
data-analysis cases), but it's been quite functional for me. It doesn't
have explicit support for masked arrays. I would be interested in any
progress you make, but I don't really have time to contribute to further
development at this point.

Cheers!
Andrew

Michael Sorich wrote:

> Hi,
>
> I am looking for a table like array. Something like a 'data frame'
> object to those familiar with the statistical languages R and Splus.
> This is mainly to hold and manipulate 2D spreadsheet like data, which
> tends to be of relatively small size (compared to what many people
> seem to use numpy for), heterogenous, have column and row names, and
> often contains missing data. A RecArray seems potentially useful, as
> it allows different fields to have different data types and holds the
> name of the field. However it doesn't seem easy to manipulate the
> data. Or perhaps I am simply having difficulty finding documentation
> on there features.
> eg
> adding a new column/field (and to a lesser extent a new row/record) to
> the recarray
> Changing the field/column names
> make a new table by selecting a subset of fields/columns. (you can
> select a single field/column, but not multiple).
> merging tables (concatenate seems to allow a recarray to be added as
> new rows but not columns)
> It would also be nice for the table to be able to deal easily with
> masked data (I have not tried this with recarray yet) and perhaps also
> to be able to give the rows/records unique ids that could be used to
> select the rows/records (in addition to the row/record index), in the
> same way that the fieldnames can select the fields.
>
> Can anyone comment on this issue? Particularly whether code exists for
> this purpose, and if not ideas about how best to go about developing
> such a Table like array (this would need to be limited to python
> programing as my ability to program in c is very limited).
>
> Thanks,
>
> michael
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user at scipy.net
>http://www.scipy.net/mailman/listinfo/scipy-user
>  
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: data_frame.py
Type: text/x-python
Size: 17578 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20060301/37207ae2/data_frame-0001.py


More information about the SciPy-user mailing list