This line of code is not working the way I thought it would:
val df2 = df1
.withColumn("email_age", when('age_of_email <= 60, 1))
.withColumn("email_age", when('age_of_email <= 120, 2))
.withColumn("email_age", when('age_of_email <= 180, 3).otherwise(4))
I have thousands of lines in df1 with age_of_email
that are less than 60 and/or less than 120, but all my lines are getting categorized as 3 or 4:
Any insight into why this is happening?