使用下面的代码尝试按年份计算条目数,返回 unicode 值错误。下面的实现有替代方案吗?raw_news_4.groupby(raw_news_4["date_publish"].map(lambda x: x.year))#raw_news_4 sampledate_publish title213059 2006-10-18 12:47:13 Is God dead Atheism finds a market in US20559 2006-11-12 13:11:20 WITNESS Waking up paralyzed in Sri Lankas war zone111765 2007-01-18 23:02:00 AIDS in Americas123806 2007-01-18 23:02:00 Malaria7060 2007-01-18 23:02:00 AIDS pandemic121746 2007-01-18 23:02:00 Indonesia mudflow206142 2007-01-18 23:02:00 Pakistan violence241749 2007-01-18 23:02:00 AttributeError: 'unicode' object has no attribute 'year'
添加回答
举报
0/150
提交
取消