File tree 2 files changed +7
-7
lines changed
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):
1037
1037
dtype = np .bool_
1038
1038
1039
1039
elif is_integer (val ):
1040
- if isinstance (val , int ):
1041
- dtype = np .int64
1042
- else :
1040
+ if isinstance (val , np .integer ):
1043
1041
dtype = type (val )
1042
+ else :
1043
+ dtype = np .int64
1044
1044
1045
1045
elif is_float (val ):
1046
- if isinstance (val , float ):
1047
- dtype = np .float64
1048
- else :
1046
+ if isinstance (val , np .floating ):
1049
1047
dtype = type (val )
1048
+ else :
1049
+ dtype = np .float64
1050
1050
1051
1051
elif is_complex (val ):
1052
1052
dtype = np .complex_
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def test_infer_dtype_from_scalar(self):
109
109
np .uint64 , np .int64 ]:
110
110
data = dtypec (12 )
111
111
dtype , val = com ._infer_dtype_from_scalar (data )
112
- self .assertEqual (dtype , dtypec )
112
+ self .assertEqual (dtype , type ( data ) )
113
113
114
114
data = 12
115
115
dtype , val = com ._infer_dtype_from_scalar (data )
You can’t perform that action at this time.
0 commit comments