Posts by Ruan Valente Stafuzza • 11 points
2 posts
-
0
votes2
answers126
viewsA: Python Pandas - How to check if a "tuple" of two Series elements is contained in a set?
I found a solution: df['A'] = list(zip(df.one, df.two)) df['three'] = df['A'].isin(set)
-
1
votes2
answers126
viewsQ: Python Pandas - How to check if a "tuple" of two Series elements is contained in a set?
I have a "set" of "tuples" as follows set = {(2, 3), (2, 4), (5, 5)} My Dataframe is like this: df = pd.DataFrame( {'one': [1,2,4,1], 'two' : [5,3,2,2]}) I want to check if in each row the "tuple"…