0 Vote Logistic Regression with a Neural Network Mindset reshape

In course 1 week 2 assignment for reshape this code works but the below code does not work. can anyone tell me why is that?

train_set_x_flatten = train_set_x_orig.reshape(train_set_x_orig.shape[0], -1).T
test_set_x_flatten = test_set_x_orig.reshape(test_set_x_orig.shape[0], -1).T

why not this—>

train_set_x_flatten = train_set_x_orig.reshape(num_px num_px 3,m_train)
test_set_x_flatten = test_set_x_orig.reshape(num_px num_px 3,m_test)

train_set_x shape: (209, 64, 64, 3)
train_set_y shape: (1, 209)

The second method trashes the data. Here’s a thread which explains this in detail.