pydata/pandas — Issue #820: dtype of result of string comparison wrong
Author: adamklein
Created: 2012-02-23 16:34:54+00:00
State: open
Labels: Bug, prio-high

Recreation from mailing list, works in 0.7 but not in master:

from pandas import *
df = DataFrame([{ "a" : 1, "b" : "foo" }, {"a" : 2, "b" : "bar"}])
print df
mask_a = df.a > 1
print "Mask A"
print mask_a
print mask_a.dtype
print df[mask_a]
print df[-mask_a]

mask_b = df.b == "foo"
print "Mask B"
print mask_b
print mask_b.values.dtype
print df[mask_b]
print df[-mask_b]