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.


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()