[英]How to add a new column rank on based on increasing value of other column in Pandas
I have this dataframe with which i am trying to create a new column rank on basis of increasing values of column Opportunity with pandas我有这个 dataframe,我正在尝试根据 pandas 列Opportunity的增加值创建一个新的列排名
State Brand DYA Opportunity
Delhi Pampers -8.58 -1.24139
Delhi Ariel 0.53 0.04800
Delhi Fusion 0.68 0.00492
Delhi Gillette 1.56 0.02073
required output --必填 output --
State Brand DYA Opportunity Rank
Delhi Pampers -8.58 -1.24139 1
Delhi Ariel 0.53 0.04800 4
Delhi Fusion 0.68 0.00492 2
Delhi Gillette 1.56 0.02073 3
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.