|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 wp231957 于 2024-7-24 14:10 编辑
在尝试使用>>> dfb = dfb.drop_duplicates(subset='ym', keep='first') 去重时 出现错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'dict' object has no attribute 'drop_duplicates'
具体过程如下:
>>> dfa=pd.read_excel("monthtiqu2.xlsx")
>>> dfb={}
>>> dfb["ym"] = dfa['日期'].dt.to_period('M')
>>> dfb = dfb.drop_duplicates(subset='ym', keep='first')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'dict' object has no attribute 'drop_duplicates'
>>> |
|