We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f100ebf commit a15fee0Copy full SHA for a15fee0
pandas/tests/test_index.py
@@ -1909,6 +1909,19 @@ def test_astype(self):
1909
self.assertTrue(i.equals(result))
1910
self.check_is_index(result)
1911
1912
+ def test_promote_type(self):
1913
+ # GH-9966
1914
+ index_int = Int64Index(np.arange(5))
1915
+ operators = (operator.add,
1916
+ operator.sub,
1917
+ operator.mul,
1918
+ operator.truediv,
1919
+ operator.floordiv)
1920
+ for op in operators:
1921
+ index_promoted = op(index_int, np.pi)
1922
+ self.assertEqual(index_promoted.dtype, np.float64)
1923
+ self.assertIsInstance(index_promoted, Float64Index)
1924
+
1925
def test_equals(self):
1926
1927
i = Float64Index([1.0,2.0])
0 commit comments