data looks like this:
col1 col2
1 med
1 low
1 high
2 high
3 low
2 high
3 low
there is two columns, i want to group col2 and count each item in col1, e.g. how many ones and twos have 'maRali' feature.
used get_dummies to convert categorical variables to numeric, but while plotting get error:
TypeError: 'DataFrame' objects are mutable, thus they cannot be hashed
here is the whole code:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
data = data = pd.read_csv(r"C:\Users\givi.jalaghania\.spyder-py3\07_maragebi.csv")
to_numeric = pd.get_dummies(data['riskiaobis done'])
ct = ['datvla']
# data.groupby(ct).agg('count').plot(kind = 'bar')
data.groupby(ct, to_numeric).size()