Filter Pyspark dataframe column with None value

前端 未结 10 1754
小鲜肉
小鲜肉 2020-11-29 18:10

I\'m trying to filter a PySpark dataframe that has None as a row value:

df.select(\'dt_mvmt\').distinct().collect()

[Row(dt_mvmt=u\'2016-03-27\         


        
10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 18:31

    if column = None

    COLUMN_OLD_VALUE
    ----------------
    None
    1
    None
    100
    20
    ------------------
    

    Use create a temptable on data frame:

    sqlContext.sql("select * from tempTable where column_old_value='None' ").show()
    

    So use : column_old_value='None'

提交回复
热议问题