Meshgrid 等高线图的不一致数据集

Meshgrid an inconsistent dataset for a contour plot

我将不一致的数据集更改为一致的数据集。现在我遇到了这个问题:我不明白如何用三个 1D Dataframe 列创建轮廓。

如何为等高线图网格化它们? 三列是:

data_month['Timestamp'], data_month['Altitude_[m]'], data_month['Horizontal_Wind_Speed_[m/s]']

维度是:

Name:  Timestamp, Length: 10692, dtype: datetime64[ns]
--------
Name: Altitude_[m], Length: 10692, dtype: int64
---------
Name: Horizontal_Wind_Speed_[m/s], Length: 10692, dtype: float64

那么我如何才能对网格进行重塑呢? data_month['Altitude_[m]'] 每 33 步重复一次。

非常感谢。

所以我找到了解决办法。 对我来说这很管用。

yi = np.linspace(minimum_range_m, maximum_range_m, number_of_gates)
xi = list(set(pd.to_datetime(data_month['Timestamp'].values.tolist())))
xi.sort()

zi = data_month['Horizontal_Wind_Speed_[m/s]'].values.tolist()
Zi = np.reshape(zi, (len(xi),len(yi))).T

fig, ax = plt.subplots()
cp = plt.contourf(xi, yi, Zi)
fig.colorbar(cp)
plt.show()