我有这样的数据
ID StartDate EndDate DesigCode FacilityID
------------------------------------------------------------
1 1-Jan 2015 1-Feb 2015 1 1
2 3-Feb 2015 10-Mar 2015 1 2
3 5-Apr 2015 3-June 2015 2 1
4 2-Jul 2015 6-Aug 2015 3 1
5 15-Sep 2015 30-Oct 2015 3 4
6 14-Nov 2015 1-Dec 2015 1 4
我要查询的结果是DesigCode
列中连续相同值的最早日期。
ID StartDate EndDate DesigCode FacilityID
------------------------------------------------------------
1 1-Jan-2015 1-Feb 2015 1 1
3 5-Apr 2015 3-June 2015 2 1
4 2-Jul 2015 6-Aug 2015 3 1
6 14-Nov 2015 1-Sec 2015 1 4
我对这个查询一无所知。
答案 0 :(得分:0)
尝试以下查询。它将返回每个设计代码的最低结束日期的记录。
from skimage import data
from skimage.filters import sobel
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from matplotlib import cm
from scipy.ndimage import zoom
coins = data.coins()
coins = zoom(coins, 10)
elevation_map = sobel(coins)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
m, n=elevation_map.shape
X, Y = np.meshgrid(np.arange(n), np.arange(m))
ax.plot_surface(X, Y, elevation_map, cmap=cm.viridis, antialiased=False)
ax.axis("off")
ax.set_facecolor('black')
plt.show()