Count of 2 dataframes
Question:
I have 2 dataframes of top songs both on spotify and tiktok. In those dataframes I have colums with the names of the top songs of 2022 and I was wondering how to know the amount of songs that are on both columns of the separate dataframes.
I haven’t really try much cause I don’t know where to start.
Answers:
One approach is to convert song names columns in both dataframes to set, and then union them with each other
set(spotify_df.songName).union(set(tiktok_df.songName))
I have 2 dataframes of top songs both on spotify and tiktok. In those dataframes I have colums with the names of the top songs of 2022 and I was wondering how to know the amount of songs that are on both columns of the separate dataframes.
I haven’t really try much cause I don’t know where to start.
One approach is to convert song names columns in both dataframes to set, and then union them with each other
set(spotify_df.songName).union(set(tiktok_df.songName))