[SciPy-User] accessing a set of columns from a recarray
Vincent Davis
vincent@vincentdavis....
Sun Mar 21 21:20:32 CDT 2010
To many distractions let me try to write that a little better.
I have a record array and a list of columns for which I would like to get
the row means. My current solution is to iterate though the list of column
names and make a new "normal" array. then calculate the row means. I would
like to do something like np.mean(A['x','y','z']) where x,y,z are the tiles
of the columns
*Vincent Davis
720-301-3003 *
vincent@vincentdavis.net
my blog <http://vincentdavis.net> |
LinkedIn<http://www.linkedin.com/in/vincentdavis>
On Sun, Mar 21, 2010 at 7:52 PM, Vincent Davis <vincent@vincentdavis.net>wrote:
> I have a few things I am trying to understand.
> I have a record array and and I list of columns for which I would like to
> get the row means. My current solution is to iterate though my list of
> column names and make a new "normal" array. I would like to do something
> like np.mean(A['x','y','z'])
> It would be great to append the results as an additional column to the
> array, but I think I have seen how to do this.
>
> Next, to make it a little more interesting I have a column that has values
> 0-14. I would like to get the mean of a row conditional on the value of this
> column. Ideally I get a new array with columns 0-14 with missing values
> where needed.
>
> I hope this is clear, please ask for clarification if not.
>
>
> *Vincent Davis
> 720-301-3003 *
> vincent@vincentdavis.net
> my blog <http://vincentdavis.net> | LinkedIn<http://www.linkedin.com/in/vincentdavis>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20100321/b9fcb5da/attachment.html
More information about the SciPy-User
mailing list