Skip to content
Advertisement

Tag: dataframe

python pandas get distinct matches in columns

I have a dataframe which looks a bit like what this code gives: What I want to end up with is a list of lists or dataframe or something similar which tells me the distinct matches across both columns in both directions. It’d be something like this: I have tried to do it but I can’t get it to go

Trouble when adding values for NaN in DataFrame

I have this DataFrame: And I want to fill the NaN values with keyword taken from the description. To that end I created a list with the keywords I want: Finally, I want to loop over each row in the DataFrame. Split the contents from the “description” column in each row and, if that word is also in the “keyword”

Advertisement