如何使用python的数据表按日期过滤

问题描述 投票:0回答:1

我具有以下数据表,我希望按大于“ 2019-01-01”的日期进行过滤。问题在于日期是字符串。


dt_dates = dt.Frame({"days_date": ['2019-01-01','2019-01-02','2019-01-03']})

这是我的最佳尝试。

dt_dates[f.days_date > datetime.strptime(f.days_date, "2019-01-01")]

这将返回错误

TypeError:strptime()参数1必须是str,而不是Expr

什么是在python的数据表中过滤日期的最佳方法?

参考

python datatable

f-expressions

python datatable
1个回答
0
投票

“ f-days_date”的值是多少?

Reagrds。

© www.soinside.com 2019 - 2024. All rights reserved.