在弄清楚如何编码时需要帮助。我有2个过滤器要在Dataframe中检查并分配值。
filters = "LIST_A in {0} AND LIST_B not in {1}".format(include_list,EXCLUDE_list)
amount = "AND AMT_PD >= 10"
find_df = old_df.if(old_df.format(filters,amount)):
old_df = old_df.withColumn("ID", F.lit('FOUND'))
else:
old_df = old_df.withColumn("ID", F.lit('NOT_FOUND'))