假设一个数据框
col1
0 3000
1 500
2 20
我想将所有值<100
映射到值low
; >=100 && <=500
设为值medium
,值>500
设为large
。因此目标数据框将是:
col1 col2
0 3000 large
1 500 medium
2 20 low
Understood,map
和replace
基本上适合替换/映射精确值,但是范围呢?