time = np.array([0, 1, 2, 4, 7]) temp = np.array([30, 32, 34, 35, 36]) np.gradient(temp, time)