How to find top n% of records in a dataframe and change it to 1, otherwise 0

前端 未结 0 1321
温柔的废话
温柔的废话 2020-11-22 00:06

I have a data frame like:

v1 v2 v2 v4 v5 v6 v7 v8
1  10 8  8  50 19 41 20
11 21 87 67 23 49 14 0
88 24 55 67 24 67 56 90

what I want is that

相关标签:
回答
  • 消灭零回复
提交回复
热议问题