Skip to content

Instantly share code, notes, and snippets.

@arkottke
Created November 26, 2013 14:52
Show Gist options
  • Save arkottke/7659652 to your computer and use it in GitHub Desktop.
Save arkottke/7659652 to your computer and use it in GitHub Desktop.
A little demo of np.recarrays
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