• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

熊猫四种数值分盒方法的总结与比较


Recommended Posts

分箱是一种常见的数据预处理技术,有时也称为分桶或离散化。它可用于将连续数据的间隔分组到“盒子”或“桶”中。在本文中,我们将讨论使用python熊猫库的宁滨数值的四种方法。

kurbzuxglfn4534.jpg

我们为演示创建了以下合成数据。

将熊猫作为pd #版本1.3.5导入

将numpy作为np导入

def创建_df():

df=pd。data frame({ ' score ' : NP . random . randint(0,101,1000)})

返回df

create_df()

df.head()

数据包括1000名学生0到100分的考试成绩。这次的任务是将数值分数分为数值“A”、“B”、“C”三个等级,其中“A”是最好的,“C”是最差的。

nbanlh2otma4535.png

1、between loc

完整文章:

https://avoid.overfit.cn/post/dc11c84491e841dea928d652f0f93005

Link to comment
Share on other sites