Why do we transpose the planar data?

In the week 3 coding exercise, we have planar data.
This data contains two classes;

The shape of X is: (2, 400)
The shape of Y is: (1, 400)
I have m = 400 training examples!

When we train the logistic regression model why do we transpose X and Y? I thought that the training examples are already stacked horizontally to the right. Transposing this will result in a matrix with 2 columns each representing a class. Can someone please help me get an intuition of why we do this?

Train the logistic regression classifier

clf = sklearn.linear_model.LogisticRegressionCV();
clf.fit(X.T, Y.T);

It just depends on what the scikit code is designed to expect. Their code works differently than the algorithm we are building here. It is not really relevant to what we are doing here, but you are welcome to dig deeper in the scikit documentation to understand how their APIs work.