I am stuck on probably an elementary problem with pandas DataFrame. In the following code snippet, I insert a calculated column 'CAPACITY_CHECK' then I try to group by the data based on it. But I keep having the following error: TypeError: unhashable type: 'numpy.ndarray'
TEMP['CAPACITY_CHECK'] = TEMP[['ADD_CAPACITY_ST', 'CAPACITY_ST', 'VOLUME_PER_SUPPLIER']].apply(lambda X: numpy.where(X[0]+X[1]<X[2],'Non OK', 'OK'), axis=1)
TEMP.groupby('CAPACITY_CHECK')['ID'].count()
Since I am not trying to modify any immutable object and the new column's type is "Series", I don't understand why I am having the error.
Thanks in advance