value_counts to list 1

value_counts to list


# get indexes

# get values of occurrences

Here is what the above code is Doing:
1. df[column].value_counts() – this is a pandas series that contains the counts of each value in the column
2. df[column].value_counts().index.tolist() – this is a list of the indexes of the series
3. df[column].value_counts().values.tolist() – this is a list of the values of the series

Similar Posts