从由字符串数组 pyspark 或 python 高阶函数多个值组成的列中选择
我有这样的表,我想根据列上列出的内容创建一个新列 示例
df.withcolumn('good',。何时('java'或'php'isin ['booksIntereste'])。lit(1).otherwise(0))
i have a table like this and i want to create a new column based on what is listed on the column
example
df.withcolumn('good',.when('java' or 'php' isin ['booksIntereste']).lit(1).otherwise(0))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以直接使用
高阶函数
- array_contains 为此,另外您可以浏览 这篇文章了解更多数据准备
Array Contains
ForAll Array Contains - 多种的
You can directly use a
Higher Order Function
- array_contains for this , additionally you can browse through this article to understand moreData Preparation
Array Contains
ForAll Array Contains - Multiple