wangzhegeek / EGES

388 stars 144 forks source link

agg(list)代码报错,请大佬看看。 #6

Closed lijian10086 closed 4 years ago

lijian10086 commented 4 years ago

def get_session(action_data, use_type=None) 中的group_action_data = action_data.groupby('user_id').agg(list) 为何是agg(list)? agg聚合操作,传入的参数list是不是有误?参数list代码在这一行时候报错了。

报错信息: File "E:/0001CTR/召回算法汇总/EGES/EGES-master/data_process.py", line 32, in get_session group_action_data = action_data.groupby('user_id').agg(list) File "D:\Anaconda2\envs\py3\lib\site-packages\pandas\core\groupby.py", line 3597, in aggregate return super(DataFrameGroupBy, self).aggregate(arg, *args, *kwargs) File "D:\Anaconda2\envs\py3\lib\site-packages\pandas\core\groupby.py", line 3114, in aggregate result, how = self._aggregate(arg, _level=_level, args, **kwargs) File "D:\Anaconda2\envs\py3\lib\site-packages\pandas\core\base.py", line 564, in _aggregate return self._aggregate_multiple_funcs(arg, _level=_level), None File "D:\Anaconda2\envs\py3\lib\site-packages\pandas\core\base.py", line 616, in _aggregate_multiple_funcs return concat(results, keys=keys, axis=1) File "D:\Anaconda2\envs\py3\lib\site-packages\pandas\tools\merge.py", line 845, in concat copy=copy) File "D:\Anaconda2\envs\py3\lib\site-packages\pandas\tools\merge.py", line 878, in init raise ValueError('No objects to concatenate') ValueError: No objects to concatenate

wangzhegeek commented 4 years ago

pandas版本问题吧。。

lijian10086 commented 4 years ago

@wangzhegeek 请问你的pandas是什么版本?

wangzhegeek commented 4 years ago

1.0.1