#用cut函数对于年龄进行分段分组,用bins来对年龄进行分段,左开右闭
age_groups=pd.cut(df[‘Age’],bins=[0,18,35,55,70,100])
pandas cut 的方法
最新推荐文章于 2024-05-19 10:37:35 发布
#用cut函数对于年龄进行分段分组,用bins来对年龄进行分段,左开右闭
age_groups=pd.cut(df[‘Age’],bins=[0,18,35,55,70,100])