我有一个Dataframe,它有5列cola,colb,country,start\u time,end\u time。我需要在做了下面的处理之后,从现有的df中形成一个新的df
If df.country == US then we have to do df.filter(start_time < todays date)
For remaining countries we have to do df.filter(end_time < todays date)
我有一个Dataframe,它有5列cola,colb,country,start\u time,end\u time。我需要在做了下面的处理之后,从现有的df中形成一个新的df
If df.country == US then we have to do df.filter(start_time < todays date)
For remaining countries we have to do df.filter(end_time < todays date)
1条答案
按热度按时间x8goxv8g1#
您可以通过应用两个过滤器来实现这一点,首先是国家,然后是日期