Hi,

I'll just comment on the creation of your dtype:

> dt = [("<f8", "<f8")]

You are creating a dtype with one field called '<f8' and with type '<f8':

>>> dt = [("<f8", "<f8")]
>>> dty = np.dtype(dt)
>>> dty.names

('<f8',)

What you may want are two fields with type '<f8' and without fieldname:

>>> dt = [("<f8", "<f8")]
>>> dty = np.dtype(('<f8,<f8'))
>>> dty.names

('f0', 'f1')
>>> dty.descr

[('f0', '<f8'), ('f1', '<f8')]

I can't help you with the json-module and what it's doing there. As the
output is unequal to the input, I suspect JSON to be misbehaving here.
If you need to store the dtype as strings, not as binary pickle, you can
use pickle.dumps and pickle.loads


_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to