Python, Pandas, Data Science, Machine Learning, Pandas Dataframe.
group_by followed by the size method. %timeit df["Car"].value_counts() #49.1 ms ± 378 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) """ Toyota 111601 Porsche 111504 Jaguar 111313 Fiat 111239 Nissan 110960 Bmw 110906 Audi 110642 Mercedes 110389 Name: Car, dtype: int64 """ %timeit