So to recap, x is an nx by m dimensional matrix, and when you implement this in Python, you see that x.shape, the python command for finding the shape of the matrix, that this an nx, m. That means it is an nx by m dimensional matrix. So that’s how you group the training examples, and input x into a matrix.
I have recently completed the new MLS course2(Advanced network algorithms). In that course the shape of X was m,nx. even in the practice X.shape is m,nx