我尝试使用pandas dataframe来检索结果,以获得相同的结果SELECT strftime('%m', date_report) as month, count(*)where has_travel_history = 't' and age >= '50' order by total_infector desc limit 2import pandas
我刚接触Python/pandas,背景是R。我在理解如何操作现有列以基于现有列的多个条件创建新列时遇到了问题。有10个不同的条件需要满足,但为了简单起见,我将使用两种情况的场景。Date),"-",month(df$Date),"-01")df$Fiscal <- as.Date(df$Fiscal, for