the error is - too many indices in the array, but i have done the same thing as the mentor.
def getDataPairForSVM(d1,d2):
l1,l2 = d1.shape[0],d2.shape[0]
samples = l1+l2
features = d1.shape[1]
data_pair = np.zeros((samples,features))
data_labels = np.zeros((samples,))
data_pair[:l1,:] = d1
data_pair[l1:,:] = d2
data_labels[:l1] = -1
data_labels[l1:] = +1
return data_pair,data_labels