enter image description here我有一个包含两列的数据框(文本,有用)。我想将大于20的“有用”列中的任何值替换为1,否则设置为零。需要一些帮助。我在databricks社区中使用Scala
+--------------------+------+
|Located in a base...| 0|
| I am not a vegeta | 12|
+--------------------+------+
| text|useful|
+--------------------+------+
|Located in a base...| 0|
|I am not a vegeta...| 1|
|There is so many ...| 12|
|Disclaimer: this ...| 0|
|House Special Chi...| 0|
|The food at Chez ...| 2|
|Overall not bad. ...| 3|