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