This line is unnecessary:

    In [1]: x = np.arange(5)

    In [2]: x.reshape(x.shape[0], -1).shape
    Out[2]: (5, 1)

    In [3]: x.reshape(x.shape[0], 1).shape
    Out[3]: (5, 1)