my_list = [[1960, 'W0'],[2001, 'D5']]

my_arr = np.array(my_list, dtype=('uint', '|S2'))

gives me an error I don't understand:

      ValueError: mismatch in size of old and new data-descriptor

What  are the old and new?  I get the same problem if try np.asarray()

If  I make the dtype ('|S4', '|S4')  I can read in as strings without errors

How do I convert a list of mixed types to a structured array?

Thanks for any pointers.
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to