I have a quick question:
I have an array like this:
array([('A', 'B'),
('C', 'D'),
dtype=[('group1', '<U4'), ('group2', '<U4')])
And I would like to combine group1 and group2 into 1 like this:
array([('A_B'),
('C_D'),
dtype=[('group3', '<U4')])
I tried some different things from other answers like this:
array_test = np.array([])
for group in array_test:
combi = np.append(combi,np.array(group[0]+"_"+group[1]))
this does give me a new array with what I want, but when I try to add it to the array I get an error which I can't figure out (don't really know what it means):
np.append(test_array, combi, axis=1)
numpy.AxisError: axis 1 is out of bounds for array of dimension 1
I tried other thing with concaternate as well but it gave the same error
could someone help me?