我pyspark.sql.Row
對象的列表如下:Pyspark:過濾DataaFrame其中列值的行列表等於某個值對象
[Row(artist=1255340), Row(artist=942), Row(artist=378), Row(artist=1180), Row(artist=813)]
從DataFrame
有模式(id, name)
我想filter
了行,其中id equals some artist in the given Row of list
。什麼纔是正確的方法呢?
爲了進一步澄清,我想要做的事,如:select row from dataframe where row.id is in list_of_row_objects
這裏有一種方法:http://stackoverflow.com/questions/35870760/filtering-a-pyspark-dataframe-with-sql-like-in-clause – karthikr
@KarthikRavindra非常感謝:) – bawejakunal