问题描述
我是编码新手,目前正在尝试找出如何找出从数据帧绘制的两条曲线的交点。
曲线是:
这是我现在拥有的代码。
GZ_positive = data.loc[data["GZ"] >= 0]
x_new = GZ_positive['heel']
y_new = GZ_positive['GZ']
wind_heeling = pd.read_csv('wind_heeling.csv')
GZ_positive['GZ'] = GZ_positive['GZ']/13400
wind_heeling['GZ_wind'] = wind_heeling['GZ_wind']/13400
x_wind = wind_heeling['Heel']
y_wind = wind_heeling['GZ_wind']
plt.figure()
plt.plot(x_new,y_new)
plt.plot(x_wind,y_wind)
plt.grid(True)
plt.show()
然后我想在交点之前和之后删除橙色线的所有点。此分析的目的是计算橙色图形下方但与蓝色图形相交的点之间的面积:
在网上发现了一些类似的问题,但似乎没有任何效果(或者我做错了)。如果有人能指出我正确的方向,我将不胜感激。谢谢!