对不起,我的英语不好。
我会用#[80000 rows x 3 columns]
df = pd.concat([df] * 10000, ignore_index=True)
#print (df)
In [236]: %timeit df[df['date_id'].between(df['start_date'], df['end_date_y'])]
2.44 ms ± 92.1 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
In [237]: %timeit df[(df['date_id'] >= df['start_date']) & (df['date_id']<= df['end_date_y'])]
2.42 ms ± 193 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
In [238]: %timeit df.query("start_date <= date_id <= end_date_y")
4.45 ms ± 14.3 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
的颜色(从列表中绘制),但是我得到的数字是(-256,16776961 ......);
TextView