Skip to content

Commit

Permalink
Merge pull request #11662 from jreback/scalar
Browse files Browse the repository at this point in the history
COMPAT: compat of scalars on all platforms, xref #11638
  • Loading branch information
jreback committed Nov 20, 2015
2 parents 3fb7c83 + b52b7fc commit a3fd834
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 a3fd834

Please sign in to comment.