From 7a4e9fd61a9d5b49f0124eea9c81f0a5886efabc Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Wed, 4 May 2016 19:10:19 -0400 Subject: [PATCH] ENH: Make None the default for string columns. --- zipline/pipeline/data/testing.py | 10 ++++++---- zipline/utils/numpy_utils.py | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/zipline/pipeline/data/testing.py b/zipline/pipeline/data/testing.py index 82579f7d..52873685 100644 --- a/zipline/pipeline/data/testing.py +++ b/zipline/pipeline/data/testing.py @@ -20,17 +20,19 @@ class TestingDataSet(DataSet): bool_col = Column(dtype=bool_dtype, missing_value=False) bool_col_default_True = Column(dtype=bool_dtype, missing_value=True) + float_col = Column(dtype=float64_dtype) + datetime_col = Column(dtype=datetime64ns_dtype) + int_col = Column(dtype=int64_dtype, missing_value=0) - categorical_col = Column(dtype=categorical_dtype, missing_value=u'') - categorical_default_None = Column( + categorical_col = Column(dtype=categorical_dtype) + categorical_default_explicit_None = Column( dtype=categorical_dtype, missing_value=None, ) - - categorical_default_NULL = Column( + categorical_default_NULL_string = Column( dtype=categorical_dtype, missing_value=u'<>', ) diff --git a/zipline/utils/numpy_utils.py b/zipline/utils/numpy_utils.py index fbadc5c7..59a32d20 100644 --- a/zipline/utils/numpy_utils.py +++ b/zipline/utils/numpy_utils.py @@ -54,6 +54,7 @@ _FILLVALUE_DEFAULTS = { float32_dtype: nan, float64_dtype: nan, datetime64ns_dtype: NaTns, + object_dtype: None, } INT_DTYPES_BY_SIZE_BYTES = {