Skip to content
Permalink
Browse files

ENH: add more possible bool values to read_csv #1295

  • Loading branch information...
moleary authored and wesm committed Jul 26, 2012
1 parent 15717e7 commit 8161ebe64d1da75a1345c0cee62867a7aeccef6b
Showing with 4 additions and 2 deletions.
  1. +4 −2 pandas/src/inference.pyx
@@ -681,9 +681,11 @@ def maybe_convert_bool(ndarray[object] arr):
for i from 0 <= i < n:
val = arr[i]

if val == 'True' or type(val) == bool and val:
true_vals = ('True', 'TRUE', 'true', 'Yes', 'YES', 'yes')
false_vals = ('False', 'FALSE', 'false', 'No', 'NO', 'no')
if val in true_vals or type(val) == bool and val:
result[i] = 1
elif val == 'False' or type(val) == bool and not val:
elif val in false_vals or type(val) == bool and not val:
result[i] = 0
else:
return arr

0 comments on commit 8161ebe

Please sign in to comment.
You can’t perform that action at this time.