new_arr = np.insert(arr, index, arr_to_insert, axis=1)
x1= data[:,:-1]
x = np.insert(x1, index(0), values=1, axis=1)
#to add a column of 1's in the features matrix
b = np.insert(a, insert_index, values=a[:,2], axis=1)
import numpy as np
N = 10
a = np.random.rand(N,N)
b = np.zeros((N,N+1))
b[:,:-1] = a
Returns
-------
append : ndarray
A copy of `arr` with `values` appended to `axis`. Note that `append`
does not occur in-place: a new array is allocated and filled. If
`axis` is None, `out` is a flattened array.