Unsupervised Learning::Satellite Images::Single Bands
it fails as it requires a 2D array not 1D


The X in .fit(X) is 2D, where each row is one training point and the columns are the features of that training point.

It should be a list of lists:

X = [
  [feature_1, feature_2,....feature_n], # training point 1
  [feature_1, feature_2,....feature_n]  # training point 2
  .
  .
  .
  [feature_1, feature_2,....feature_n]  # training point 123
]


The K-Means will train with all the examples in X.

However, you are only giving 1 training example, namely img_A. So your X is like this at the moment: 

X = [feature_1, feature_2,....feature_n] # img_A


So, to .fit() K-Means, you need more image examples.