How to count occurrences per label?
How to count occurrences per label? Question: How can I count the 1’s and 0’s in column [1] per unique class in column [0]? labels = [] estimator = est.fit(X.iloc[:,1:]) labels.append(estimator.labels_) labels.append(O) labels = pd.DataFrame(np.array(labels).transpose()) labels.iloc[:,1] = (labels.iloc[:,1] > 5).astype(int) # Binary GOS-E x = np.array(labels.iloc[:,1]).reshape(-1, 1) y = np.array(labels.iloc[:,0]) Asked By: Sean_TBI_Research || Source …