数据框中的最高计数
我正在尝试从Google Colab中的PANDA中从CSV文件中提取10列,因此我使用此行firstTen = data.iloc [:,0:10]#所有行<的数据框架的前十列< /code>
之后,我使用firstten.count()
来计算每列中的值数,因此我想知道的是,如果其中一列中有80个不同的值,并且我想从这十列中知道其他数量最高的计数,我使用max
,但它对此没有帮助,我不需要知道哪个列只是某些数据中的数字将重复80次,例如4次,因此请牢记解决方案。我也考虑过使用排序功能,但也许还有另一种选择。
I'm trying to extract 10 columns from a csv file with pandas in Google colab so I'm using this line firstten = data.iloc[:, 0:10] # first ten columns of data frame with all rows
After that I used firstten.count()
to count the number of values in each column so after that what I want to know is that if in one of those columns have 80 different values and the others are lower I want to know from this ten columns the highest number of counts for that, I used the max
but it didn't work some help with this please I don't need to know which column just the number in some pieces of data will be repeated 80 like 4 times so also to have this in mind with the solution. Also I thought about using the sort function but maybe there is another option.
Thanks for your help this is the output that I would like to get:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论