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 !