'the nested renamer error' 如何从这个 jupyter notebook 解决
How can 'the nested renamer error' be solved from this jupyter notebook
我正在尝试为 class 复制下一个 notebook,特别是 Input [32]
行
In[32] bin_stats = joined.groupby('bins_index')['offset'].agg({'fold': len, 'min_offset': np.min})
但我收到错误 SpecificationError: nested renamer is not supported
您可以使用 named aggregation:
bin_stats = (joined.groupby('bins_index')
.agg(fold = ('offset', len),
min_offset = ('offset', np.min)))
我正在尝试为 class 复制下一个 notebook,特别是 Input [32]
行In[32] bin_stats = joined.groupby('bins_index')['offset'].agg({'fold': len, 'min_offset': np.min})
但我收到错误 SpecificationError: nested renamer is not supported
您可以使用 named aggregation:
bin_stats = (joined.groupby('bins_index')
.agg(fold = ('offset', len),
min_offset = ('offset', np.min)))