Hello,
I’m completely lost on how to loop through the breeds. specifically on groups. I’m not entirely sure how to do that
groups = df.groupby(‘breed’)
seems to be giving me pandas.core.groupby.generic.DataFrameGroupBy object at 0x7fc65e182260> which when i use to loop through with the following code :
for breed, group in groups:
df_breed = df[df[“breed”] == breed]
prob_class = df_breed[‘breed’]/len(df)
probs_dict = round(prob_class, 3)
i end up with thousands and thousands of lines:
Probability of each class for training split:
0 0.001
7 0.001
8 0.001
10 0.001
13 0.001
…
2393 0.001
2401 0.001
2402 0.001
2406 0.001
2407 0.001
what am i doing wrong?