cancel
Showing results for 
Search instead for 
Did you mean: 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

New to Spark

Anku_
New Contributor II

Hi all,

I am new to Spark, trying to write below code but getting an error.

Code:

df1 = df.filter(df.col1 > 60 and df.col2 != 'abc')
 
Any suggestion?
 
1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz_Fatma
Community Manager
Community Manager

Hi @Anku_ , use this instead :-

df1 = df.filter((df.col1 > 60) & (df.col2 != 'abc'))

View solution in original post

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @Anku_ , use this instead :-

df1 = df.filter((df.col1 > 60) & (df.col2 != 'abc'))
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!