So i'm trying to append 2 np array together but it gives me this error ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the array at index 1 has 1 dimension(s)I know that this mean the shape of the array are not the same but I don't understand why and how to fix it.
arr1 = np.array([
[10.24217065 5.63381577]
[ 2.71521988 -3.33068004]
[-3.43022486 16.40921457]
[ 1.4461307 12.59851726]
[12.34829023 29.67531647]
[16.65382971 9.8915765 ]])
arr2 = np.array([4.62643996 5.14587112])
arr3 = np.append(arr1,arr2,axis=0)
np.vstack((arr1,arr2))arr1is 2d with shape (6,2), andarr2is 1d with shape (2,). If not, then you need to read some morenumpybasics.np.appendwithaxisparameter just usesnp.concatenate([ arg1, args2], axis=0). Concatenate is picky about the number of dimensions, and patching shapes. I'd recommend staying away fromnp.append, and learn enough about dimensions to usenp.concatenatecorrectly.