1 min readJan 30, 2020
hi eoghan,
why do we need to loop?
{cls: round(float(mayority)/float(count), 2) for cls, count in counter.items()}[1])
we get the same result with two lines of code:
y_counts = y.value_counts()
max(y_counts)/min(y_counts)
looping is a bad programming practice, at least is very necessary. am i right?