You need to specify the number of bytes in your string dtype. Otherwise, numpy is setting the number of bytes to 1:
In [44]: npdata['label'].dtype
Out[44]: dtype('S1')
and truncating your data.
So, for example, if you replace S
with |S20
then the string dtype will support strings of up to 20 bytes:
npdata = np.array(map(tuple, data),
dtype=([('x', 'float64'), ('y', 'float64'), ('label', '|S20'), ]))
for entry in npdata:
print list(entry)
yields:
[100.0, 400.0, 'stringhere']
[200.0, 500.0, 'another sting']