Skip to content Skip to sidebar Skip to footer

Comparing Pandas DataFrame To Series

I've looked at this and this question so far but they didn't really help me with my problem. The problem is very simple but a little difficult to put to words. I have a Dataframe w

Solution 1:

Use .gt and pass axis=0 to compare row-wise against a Series:

In [126]:
df.gt(s, axis=0)

Out[126]:
      Stock1 Stock2
index              
Date1   True   True
Date2  False   True

Post a Comment for "Comparing Pandas DataFrame To Series"