1print (df['S'] != df['T'])
20 False
31 True
42 True
53 True
64 False
75 True
86 True
97 True
108 False
11dtype: bool
12
13df = df[df['S'] != df['T']]
14print (df)
15 S T W U
161 A B 0 Undirected
172 A C 1 Undirected
183 B A 0 Undirected
195 B C 1 Undirected
206 C A 1 Undirected
217 C B 1 Undirected