Despite this seeming an easy task, I didn't find a satisfying way of doing it. There are several solutions based on map or try/except but none of these seems to me solid enough (e.g. working in a general case and with 2D arrays).
This can be done with pandas, but I would like to avoid importing an entire library just for this task, is it possible to do it just with numpy functions?
To make an example of what I mean, from an array like:
>>a=np.vstack([['zero','one'],np.array(np.arange(2)).T]).astype('|S') >>print a [['zero' 'one'] ['0' '1']] the desired output is:
zero one 0 1