Skip to content

Commit

Permalink
Merge pull request #1315 from jakevdp/fix-1314
Browse files Browse the repository at this point in the history
BUG: specify skipna in infer_dtypes (fixes #1314)
  • Loading branch information
jakevdp authored Jan 29, 2019
2 parents 69cb10f + 2946137 commit 54f42ba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions altair/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@

try:
from pandas.api.types import infer_dtype
except ImportError: # Pandas before 0.20.0
# keywords required; see https://github.com/altair-viz/altair/issues/1314
_infer_dtype_kwds = {'skipna': False}
except ImportError:
# This is the appropriate import for pandas < 0.20.0
from pandas.lib import infer_dtype
_infer_dtype_kwds = {} # no keywords allowed in pandas < 0.20

from .schemapi import SchemaBase, Undefined

Expand Down Expand Up @@ -69,7 +73,7 @@ def infer_vegalite_type(data):
data: Numpy array or Pandas Series
"""
# Otherwise, infer based on the dtype of the input
typ = infer_dtype(data)
typ = infer_dtype(data, **_infer_dtype_kwds)

# TODO: Once this returns 'O', please update test_select_x and test_select_y in test_api.py

Expand Down

0 comments on commit 54f42ba

Please sign in to comment.