Tableau to Pandas to Plotly

I am trying to plot a scatter plot using plotly express. I am unable to deduce the average/mean component.
Can someone help me on how I can convert the below tableau to pandas.

My dataframe is as follows and scatter plot code tried out is also below.

||DrvrAge|DrvrAgeGrp|PedAge_Converted|
|---|---|---|---|
|58|50-59|30|
|23|20-24|16|
|31|30-39|21|
|29|25-29|39|
|24|20-24|26|

fig = px.scatter(df_ncdot_ped_age, x=df_ncdot_ped_age_avg2, y=df_ncdot_ped_age_avg1, labels={"DrvrAgeGrp": "Driver Age Group"}, title='Relationship between driver age and pedestrian age').update_layout(autosize=False,height=400, width=1200).show()