CodePudding user response:
trans = pca(data, 3)[0]
is theU
data, since[0]
selects the first index of the returned data, andpca
returnsU, E, V
ax2.scatter(trans[:50, 0], trans[:50, 1], c = 'r')
plots the first 50 rows of column 0 against the first 50 rows of column 1, andax2.scatter(trans[50:, 0], trans[50:, 1], c = 'b')
does the same for rows from 50 to the end. This from the sample data given in