Fit scatter plot in x axis range limits

I would like to fit a scatter plot within a certain x axis range limits. In particular I want a gaussian fit and retrieve the fit parameters.
Looking at this page I could not find a trivial solution.
The best I could manage was a rolling average over the entire range (since in statsmodel I could not find a simple gaussian fit).

fig = px.scatter(x=np.arange(1,1025,1), y=list_data2[iFile], render_mode="SVG", trendline="rolling", trendline_options=dict(window=5))

I hope someone can help.
Thank you

I assume you are referring to β€œfit” as creating a regression line.

I further assume, you want to do this with a subset of your data.

My advice for this case would be to create the regression line with a separate python lib and just plot the calculated data as new trace on the existing trace.