[Numpy-discussion] BOF notes: Fernando's proposal: NumPy ndarray with named axes

Rob Speer rspeer@MIT....
Mon Jul 12 17:30:41 CDT 2010


rec['305'] extracts a single value from a single record.
arr.named[:,305] extracts an *entire column* from a 2-D datarray,
returning you a 1-D datarray.

Once again, 1-D record arrays and 2-D labeled arrays look similar when
you print them, but the data structures are so unrelated that there is
really not much point in comparing them any further.
-- Rob

On Mon, Jul 12, 2010 at 6:01 PM, Neil Crighton <neilcrighton@gmail.com> wrote:
> Rob Speer <rspeer <at> MIT.EDU> writes:
>
>> It's not just about the rows: a 2-D datarray can also index by
>> columns, an operation that has no equivalent in a 1-D array of records
>> like your example.
>
> rec['305'] effectively indexes by column. This is one the main attractions of
> structured/record arrays.
>
>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


More information about the NumPy-Discussion mailing list