wrong result while comparing two columns of a dataframes in python

Viewed 365

These are my dataframes.

df contains no values onlly column names,

P1  |P2 |P3



df4,

    Names   Std
0   Kumar   10
1   Ravi    5



mask=df4["Names"].str.contains(('|').join(df["P1"].values.tolist()),na=False)

Out[30]:
 0    True
 1    True
Name: Names, dtype: bool

Why it is giving True value when the "P!" column does not have any value in it ?

1 Answers
Related