pyspark:数据帧中 like() 方法的计数器部分 [英] pyspark: counter part of like() method in dataframe

查看:24
本文介绍了pyspark:数据帧中 like() 方法的计数器部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

spark 数据帧中的 like() 是否有任何计数器方法(类似于 notLike())?

Is there any counter method for like() in spark dataframe (something as notLike())?

或者除了使用传统的 SQL 查询之外还有其他方法吗?

Or is there any other way to do it except using the traditonal SQL query?

我只想做与以下相反的事情:

I want to do just the opposite of the following:

df.where(col("_c2").like("XY6%")).show(5)

推荐答案

它奏效了 :)

我不得不使用否定运算符 (~) 而不是not"关键字.

I had to use the negation operator (~) instead of the 'not' keyword.

df.where(~ col("_c2").like("XY6%")).show(5)

这篇关于pyspark:数据帧中 like() 方法的计数器部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆