In [16]:
import axon
import numpy as np

In [8]:
text = """
array
  dtype: [("id" "int") ("val" "float")]
  (1 1.0)
  (2 2.0)
  (3 3.0)
"""

In [9]:
vals = axon.loads(text)
print(axon.dumps(vals, pretty=1))


array
  dtype: [
    ("id" "int")
    ("val" "float")]
  (1 1.0)
  (2 2.0)
  (3 3.0)

In [10]:
val = vals[0]

In [15]:
print(val.dtype)
print(val.__vals__)


[('id', 'int'), ('val', 'float')]
[(1, 1.0), (2, 2.0), (3, 3.0)]

In [17]:
np.array(val.__vals__, val.dtype)


Out[17]:
array([(1, 1.0), (2, 2.0), (3, 3.0)], 
      dtype=[('id', '<i8'), ('val', '<f8')])

In [ ]: