I'm attempting to perform a simple task: append an array to the beginning of another array. Here a MWE of what I mean:
a = ['a','b','c','d','e','f','g','h','i']
b = [6,4,1.,2,8,784.,43,6.,2]
c = [8,4.,32.,6,1,7,2.,9,23]
# Define arrays.
a_arr = np.array(a)
bc_arr = np.array([b, c])
# Append a_arr to beginning of bc_arr
print np.concatenate((a_arr, bc_arr), axis=1)
but I keep getting a ValueError: all the input arrays must have same number of dimensions error.
The arrays a_arr and bc_arr come like that from a different process so I can't manipulate the way they are created (ie: I can't use the a,b,c lists).
How can I generate a new array of a_arr and bc_arr so that it will look like:
array(['a','b','c','d','e','f','g','h','i'], [6,4,1.,2,8,784.,43,6.,2], [8,4.,32.,6,1,7,2.,9,23])
numpyarray to store mixed datatypes, especiallychars? I'm not sure most of thenumpyfunctionality would be available to you if you use it. Why not use a simple list or a custom class?numpyarray...a_arr,bc_arr) should stay as a sub-array within the final array like show in the question.