A simpler equivalent to np.reshape(y, (-1, 1)) is y[:, np.newaxis]. Since np.newaxis is an alias for None, y[:, None] also works. It's also worth mentioning np.expand_dims(y, axis=1).
np.reshape(y, (-1, 1))
y[:, np.newaxis]
np.newaxis
None
y[:, None]
np.expand_dims(y, axis=1)