from datetime import date
import pandas as pd
now = date.today()
data=pd.read_excel(io='F:\IGS\py\data.xlsx')
for i in data:
if i == now:
print("it's today")
from datetime import date
import pandas as pd
now = date.today()
data = pd.read_excel(io='F:\IGS\py\data.xlsx')
for index, row in data.iterrows():
if row['date_column_name'].date() == now:
print("It's today")
1条答案
按热度按时间7xllpg7q1#
不知道excel里有什么很难确定。
(1)我会确保你在列中迭代
(2)我会确保你比较的变量格式是一样的。
试着复制/粘贴并重新修改,看看是否有效: