Ex. 2, Flattening syntax problem

The -1 is not to invert the array but rather to infer the missing value

If the array cannot be reshaped then you get an error, for example, the array a cannot be reshaped as (5, -1) because there is no number to be put in place of -1 that would allow the array to be reshaped:

>>> a = np.array([0, 1, 2, 3, 4, 5])
>>> a.reshape(5, -1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: cannot reshape array of size 6 into shape (5,newaxis)