Given a dataframe that looks like this:
A B 2005-09-06 5 -2 2005-09-07 -1 3 2005-09-08 4 5 2005-09-09 -8 2 2005-09-10 -2 -
Here's a really useful page about the pandas crosstab function:
http://chrisalbon.com/python/pandas_crosstabs.html
So I think for what you'd like to do you should use
import pandas as pd pd.crosstab(data['A']>0, data['B']>0)
Hope that helps!