I tried to use the pivot_table function on a dataframe. This was working at the beginning now I get all the time errors, and don't really get why.
cols = (['B', 'C', 'D', 'E'])
dataset[cols] = dataset[cols].apply(pd.to_numeric,errors='coerce', axis=1)
score_table = dataset.pivot_table(index='A', values=['B', 'C'], aggfunc = np.mean)
print(score_table)
score_table.plot(kind="bar")
plt.savefig(filename + 'figure_meanscore.pdf')
and thats my error:
numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('<U32'), dtype('<U32')) -> dtype('<U32')