这是我的脚本:
xls = pd.ExcelFile(r'Changes log.xlsx')
df = pd.read_excel(xls, 'New Employment')
df['Start Date'] = pd.to_datetime(df['Start Date'])
today = pd.Timestamp.today()
#Calculate how many days are left til the employee starts working
df['Days Until Start'] = ((df['Start Date'] - today).dt.days)
df['Days Until Start'] = df['Days Until Start'].astype(int)
delta_df = df[['Name', 'Days Until Start']]
close_delta = delta_df[delta_df['Days Until Start'] < 10]
close_delta = delta_df[delta_df['Days Until Start'] > 0]
print(close_delta)
当我打印时,它仅使用最新的命令,该命令使用> 0
行。如何检查它们两者?我希望close delta
大于0但小于10。
谢谢:)