April 4, 2011
12:01 p.m.
Hi, I think that I have resolved my issue down to creating a structured string array. I am using numpy version '2.0.0.dev-3c338cb'. Without a structured array, it should be a 2 by 2 array:
np.array([('a','b'),('c','d')]) array([['a', 'b'], ['c', 'd']], dtype='|S1') np.array([('a','b'),('c','d')], dtype='a2') array([['a', 'b'], ['c', 'd']], dtype='|S2')
It does not work as a structured array:
np.array([('a','b'),('c','d')], dtype=[('label','a2'), ('Value', 'a4')]) array([('a', 'b'), ('c', 'd')], dtype=[('label', '|S2'), ('Value', '|S4')])
What is the correct dtype argument to use in this case? Thanks Bruce