@@ -558,7 +558,7 @@ def infer_dtype_from_scalar(val, pandas_dtype: bool = False):
558558 object
559559 """
560560
561- dtype = np .object_
561+ dtype = np .dtype ( np . object_ )
562562
563563 # a 1-element ndarray
564564 if isinstance (val , np .ndarray ):
@@ -577,7 +577,7 @@ def infer_dtype_from_scalar(val, pandas_dtype: bool = False):
577577 # instead of np.empty (but then you still don't want things
578578 # coming out as np.str_!
579579
580- dtype = np .object_
580+ dtype = np .dtype ( np . object_ )
581581
582582 elif isinstance (val , (np .datetime64 , datetime )):
583583 val = tslibs .Timestamp (val )
@@ -588,30 +588,30 @@ def infer_dtype_from_scalar(val, pandas_dtype: bool = False):
588588 dtype = DatetimeTZDtype (unit = "ns" , tz = val .tz )
589589 else :
590590 # return datetimetz as object
591- return np .object_ , val
591+ return np .dtype ( np . object_ ) , val
592592 val = val .value
593593
594594 elif isinstance (val , (np .timedelta64 , timedelta )):
595595 val = tslibs .Timedelta (val ).value
596596 dtype = np .dtype ("m8[ns]" )
597597
598598 elif is_bool (val ):
599- dtype = np .bool_
599+ dtype = np .dtype ( np . bool_ )
600600
601601 elif is_integer (val ):
602602 if isinstance (val , np .integer ):
603- dtype = type (val )
603+ dtype = np . dtype ( type (val ) )
604604 else :
605- dtype = np .int64
605+ dtype = np .dtype ( np . int64 )
606606
607607 elif is_float (val ):
608608 if isinstance (val , np .floating ):
609- dtype = type (val )
609+ dtype = np . dtype ( type (val ) )
610610 else :
611- dtype = np .float64
611+ dtype = np .dtype ( np . float64 )
612612
613613 elif is_complex (val ):
614- dtype = np .complex_
614+ dtype = np .dtype ( np . complex_ )
615615
616616 elif pandas_dtype :
617617 if lib .is_period (val ):
0 commit comments