1919from patsy import PatsyError
2020from patsy .util import atleast_2d_column_default
2121from patsy .compat import OrderedDict
22- from patsy .util import repr_pretty_delegate , repr_pretty_impl
22+ from patsy .util import repr_pretty_delegate , repr_pretty_impl , safe_issubdtype
2323from patsy .constraint import linear_constraint
2424
2525class DesignInfo (object ):
@@ -278,7 +278,7 @@ def from_array(cls, array_like, default_column_prefix="column"):
278278 raise ValueError ("design matrix can't have >2 dimensions" )
279279 columns = getattr (arr , "columns" , range (arr .shape [1 ]))
280280 if (hasattr (columns , "dtype" )
281- and not np . issubdtype (columns .dtype , np .integer )):
281+ and not safe_issubdtype (columns .dtype , np .integer )):
282282 column_names = [str (obj ) for obj in columns ]
283283 else :
284284 column_names = ["%s%s" % (default_column_prefix , i )
@@ -527,7 +527,7 @@ def __new__(cls, input_array, design_info=None,
527527 return input_array
528528 self = atleast_2d_column_default (input_array ).view (cls )
529529 # Upcast integer to floating point
530- if np . issubdtype (self .dtype , np .integer ):
530+ if safe_issubdtype (self .dtype , np .integer ):
531531 self = np .asarray (self , dtype = float ).view (cls )
532532 if self .ndim > 2 :
533533 raise ValueError ("DesignMatrix must be 2d" )
@@ -539,7 +539,7 @@ def __new__(cls, input_array, design_info=None,
539539 "(got %s, wanted %s)"
540540 % (len (design_info .column_names ), self .shape [1 ]))
541541 self .design_info = design_info
542- if not np . issubdtype (self .dtype , np .floating ):
542+ if not safe_issubdtype (self .dtype , np .floating ):
543543 raise ValueError ("design matrix must be real-valued floating point" )
544544 return self
545545
0 commit comments