手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

FutureWarning

时间:2024-10-12 15:29:45

1、python机器学习实践指南,原书蜣贺鱿柢代码:df.groupby('class')['petal width']\.agg({'de造婷用痃lta': lambda x :x.max() - x.min(), 'max': np.max,'min':np.min})

FutureWarning

2、运行后报错:FutureWarning: using a dict on a Series for aggregationis deprecated and will be remove颊俄岿髭d in a future version 'max': np.max,'min':np.min})

FutureWarning

3、修改如下:def delta(group): return max(group) - min(group)df.groupby('class')['petal width'].agg([delta])

FutureWarning

4、运行结果:如下图

FutureWarning

5、详情请参见:http://pandas.pydata.org/pandas-docs/stable/.打不开请越狱

6、有用的话请给我投票吧,谢谢!!!

© 手抄报圈