I would like to filter Id from price where exist in events dataframe. My code is below but it is not working in pyspark. How am I going to fix this?
events = spark.createDataFrame([(657,'Conferences'),
(765, 'Seminars '),
(776, 'Meetings'),
(879, 'Conferences'),
(765, 'Meetings'),
(879, 'Seminars'),
(985, 'Meetings'),
(879, 'Meetings'),
(657, 'Seminars'),
(657,'Conferences')]
,['Id', 'event_name'])
events.show()
price = spark.createDataFrame([(657,10),
(879,45),
(776,54),
(879,45),
(765, 65)]
,['Id','Price'])
price[price.Id.isin(events.Id)].show()