guopengfa
发布于 2020-05-28 / 787 阅读 / 0 评论 / 0 点赞

pandas分段函数

data1["cut"] = pd.cut(data1["key1"],bins=[10,15,20,30],labels=["下","中","上"],include_lowest=False)

评论