Skip to content

Commit

Permalink
Fix weird test failure on pandas 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
njsmith committed Mar 4, 2015
1 parent 45d43ce commit ed47ef6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions patsy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,9 @@ def test_iterable():
def pandas_Categorical_from_codes(codes, categories):
assert have_pandas_categorical

# Old versions of pandas sometimes fail to coerce this to an array and
# just return it directly from .labels (?!).
codes = np.asarray(codes)
if hasattr(pandas.Categorical, "from_codes"):
return pandas.Categorical.from_codes(codes, categories)
else:
Expand Down

0 comments on commit ed47ef6

Please sign in to comment.