I have a data frame and I would like to know how many times a given column has the most frequent value.
I try to do it in the following way:
items_counts = df['item'].value_counts()
max_item = items_counts.max()
As a result I get:
ValueError: cannot convert float NaN to integer
As far as I understand, with the first line I get series in which the values from a column are used as key and frequency of these values are used as values. So, I just need to find the largest value in the series and, because of some reason, it does not work. Does anybody know how this problem can be solved?