File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1037,16 +1037,16 @@ def _infer_dtype_from_scalar(val):
10371037 dtype = np .bool_
10381038
10391039 elif is_integer (val ):
1040- if isinstance (val , int ):
1041- dtype = np .int64
1042- else :
1040+ if isinstance (val , np .integer ):
10431041 dtype = type (val )
1042+ else :
1043+ dtype = np .int64
10441044
10451045 elif is_float (val ):
1046- if isinstance (val , float ):
1047- dtype = np .float64
1048- else :
1046+ if isinstance (val , np .floating ):
10491047 dtype = type (val )
1048+ else :
1049+ dtype = np .float64
10501050
10511051 elif is_complex (val ):
10521052 dtype = np .complex_
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def test_infer_dtype_from_scalar(self):
109109 np .uint64 , np .int64 ]:
110110 data = dtypec (12 )
111111 dtype , val = com ._infer_dtype_from_scalar (data )
112- self .assertEqual (dtype , dtypec )
112+ self .assertEqual (dtype , type ( data ) )
113113
114114 data = 12
115115 dtype , val = com ._infer_dtype_from_scalar (data )
You can’t perform that action at this time.
0 commit comments