My pie chart is not displayed when I use the function that counts the occurrences

Hi Iโ€™m very sorry if this is a silly/simple question but Iโ€™m really stucked.

I have this kind of dataframe

image

And i would like to plot a pie chart that shows the proportion of each event in the dataframe.

The problem is when I enter the following code I only get a blank figure :

Anyone knows what Iโ€™m doing wrong ?

To sum this up the figure iโ€™d like to get is the next one :

Thank you !

You could try making a 2nd dataframe the has the number of times each value occurs. Then pass this dataframe to the pie graph

        count1 = df["event"].value_counts()
        dff = pd.DataFrame()

        dff["name"]=[str(i) for i in count1.index]
        dff["number"] = count1.values
        px.pie(dff, values="number", names="name")



Hi and thanks for your answer !
I used the same kind of trick to get the last graph but I thought px.pie had a function that count the occurences of each kind of label โ€ฆ

Maybe itโ€™s only with the go.Pie constructor, Iโ€™ll try it !