Changed np.ones_like() to np.ones(len()) for better compatability