Skip to content

Commit

Permalink
COMPAT: compat of scalars on all platforms, xref pandas-dev#11638
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Nov 20, 2015
1 parent 4900677 commit b52b7fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,16 +1037,16 @@ def _infer_dtype_from_scalar(val):
dtype = np.bool_

elif is_integer(val):
if isinstance(val, int):
dtype = np.int64
else:
if isinstance(val, np.integer):
dtype = type(val)
else:
dtype = np.int64

elif is_float(val):
if isinstance(val, float):
dtype = np.float64
else:
if isinstance(val, np.floating):
dtype = type(val)
else:
dtype = np.float64

elif is_complex(val):
dtype = np.complex_
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_infer_dtype_from_scalar(self):
np.uint64, np.int64 ]:
data = dtypec(12)
dtype, val = com._infer_dtype_from_scalar(data)
self.assertEqual(dtype, dtypec)
self.assertEqual(dtype, type(data))

data = 12
dtype, val = com._infer_dtype_from_scalar(data)
Expand Down

0 comments on commit b52b7fc

Please sign in to comment.