Created
November 26, 2013 14:52
-
-
Save arkottke/7659652 to your computer and use it in GitHub Desktop.
A little demo of np.recarrays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
r = np.rec.fromrecords([['foo', 1, 2.3], ['bar', 4, 5.6]], names=['s', 'i', 'f']) | |
r.s | |
>>> chararray(['foo', 'bar'], dtype='<U12') | |
r[1] | |
>>> ('bar', 4, 5.6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment