I want to draw a trendline that follows a few points nicely. It is supposed to be a kind of 'average' so it doesn't have to hit the points exactly, but the shape has to be a smooth arc. I am having trouble getting Python or Excel to get exactly what I want. Here is an example code that I'm using,
x = np.array([6,8,10,12,16,24,32])
y = np.array([934,792,744,710,699,686,681])
#create scatterplot
plt.scatter(x, y)
#calculate equation for quadratic trendline
z = np.polyfit(x, y, 2)
p = np.poly1d(z)
#add trendline to plot
plt.plot(x, p(x))
whereas what I'm looking for is something like
Here's another example, where the line is sharper and doesn't bottom out like the previous

Does anyone know how this can be done? When I try it on Excel it seems like an 'equation' is needed but I'm not sure how to get to this equation.
Edit: the curve I am looking for has to be monotonic decreasing and concave

To fit a curve with a desired shape, use
scipy.optimize.curve_fit. Since you want a generic1/xcurve, you can usea/(x+b) + c, whereaadjusts the curvature,badjusts the left-right position, andcadjusts the up-down position. You can see how these parameters change the shape using this Desmos plot.