|
| 1 | +From: Yaroslav Halchenko < [email protected]> |
| 2 | +Subject: BF(TST): use = (native) instead of < (little endian) for target data types (#14832) |
| 3 | + |
| 4 | +--- a/pandas/io/tests/parser/common.py |
| 5 | ++++ b/pandas/io/tests/parser/common.py |
| 6 | +@@ -1431,7 +1431,7 @@ j,-inF""" |
| 7 | + FutureWarning, check_stacklevel=False): |
| 8 | + data = 'a,b\n1,a\n2,b' |
| 9 | + expected = np.array([(1, 'a'), (2, 'b')], |
| 10 | +- dtype=[('a', '<i8'), ('b', 'O')]) |
| 11 | ++ dtype=[('a', '=i8'), ('b', 'O')]) |
| 12 | + out = self.read_csv(StringIO(data), as_recarray=True) |
| 13 | + tm.assert_numpy_array_equal(out, expected) |
| 14 | + |
| 15 | +@@ -1440,7 +1440,7 @@ j,-inF""" |
| 16 | + FutureWarning, check_stacklevel=False): |
| 17 | + data = 'a,b\n1,a\n2,b' |
| 18 | + expected = np.array([(1, 'a'), (2, 'b')], |
| 19 | +- dtype=[('a', '<i8'), ('b', 'O')]) |
| 20 | ++ dtype=[('a', '=i8'), ('b', 'O')]) |
| 21 | + out = self.read_csv(StringIO(data), as_recarray=True, index_col=0) |
| 22 | + tm.assert_numpy_array_equal(out, expected) |
| 23 | + |
| 24 | +@@ -1449,7 +1449,7 @@ j,-inF""" |
| 25 | + FutureWarning, check_stacklevel=False): |
| 26 | + data = '1,a\n2,b' |
| 27 | + expected = np.array([(1, 'a'), (2, 'b')], |
| 28 | +- dtype=[('a', '<i8'), ('b', 'O')]) |
| 29 | ++ dtype=[('a', '=i8'), ('b', 'O')]) |
| 30 | + out = self.read_csv(StringIO(data), names=['a', 'b'], |
| 31 | + header=None, as_recarray=True) |
| 32 | + tm.assert_numpy_array_equal(out, expected) |
| 33 | +@@ -1460,7 +1460,7 @@ j,-inF""" |
| 34 | + FutureWarning, check_stacklevel=False): |
| 35 | + data = 'b,a\n1,a\n2,b' |
| 36 | + expected = np.array([(1, 'a'), (2, 'b')], |
| 37 | +- dtype=[('b', '<i8'), ('a', 'O')]) |
| 38 | ++ dtype=[('b', '=i8'), ('a', 'O')]) |
| 39 | + out = self.read_csv(StringIO(data), as_recarray=True) |
| 40 | + tm.assert_numpy_array_equal(out, expected) |
| 41 | + |
| 42 | +@@ -1468,7 +1468,7 @@ j,-inF""" |
| 43 | + with tm.assert_produces_warning( |
| 44 | + FutureWarning, check_stacklevel=False): |
| 45 | + data = 'a\n1' |
| 46 | +- expected = np.array([(1,)], dtype=[('a', '<i8')]) |
| 47 | ++ expected = np.array([(1,)], dtype=[('a', '=i8')]) |
| 48 | + out = self.read_csv(StringIO(data), as_recarray=True, squeeze=True) |
| 49 | + tm.assert_numpy_array_equal(out, expected) |
| 50 | + |
| 51 | +@@ -1478,7 +1478,7 @@ j,-inF""" |
| 52 | + data = 'a,b\n1,a\n2,b' |
| 53 | + conv = lambda x: int(x) + 1 |
| 54 | + expected = np.array([(2, 'a'), (3, 'b')], |
| 55 | +- dtype=[('a', '<i8'), ('b', 'O')]) |
| 56 | ++ dtype=[('a', '=i8'), ('b', 'O')]) |
| 57 | + out = self.read_csv(StringIO(data), as_recarray=True, |
| 58 | + converters={'a': conv}) |
| 59 | + tm.assert_numpy_array_equal(out, expected) |
| 60 | +@@ -1487,7 +1487,7 @@ j,-inF""" |
| 61 | + with tm.assert_produces_warning( |
| 62 | + FutureWarning, check_stacklevel=False): |
| 63 | + data = 'a,b\n1,a\n2,b' |
| 64 | +- expected = np.array([(1,), (2,)], dtype=[('a', '<i8')]) |
| 65 | ++ expected = np.array([(1,), (2,)], dtype=[('a', '=i8')]) |
| 66 | + out = self.read_csv(StringIO(data), as_recarray=True, |
| 67 | + usecols=['a']) |
| 68 | + tm.assert_numpy_array_equal(out, expected) |
| 69 | +--- a/pandas/tests/series/test_datetime_values.py |
| 70 | ++++ b/pandas/tests/series/test_datetime_values.py |
| 71 | +@@ -326,7 +326,7 @@ class TestSeriesDatetimeValues(TestData, |
| 72 | + period_index = period_range('20150301', periods=5) |
| 73 | + result = period_index.strftime("%Y/%m/%d") |
| 74 | + expected = np.array(['2015/03/01', '2015/03/02', '2015/03/03', |
| 75 | +- '2015/03/04', '2015/03/05'], dtype='<U10') |
| 76 | ++ '2015/03/04', '2015/03/05'], dtype='=U10') |
| 77 | + self.assert_numpy_array_equal(result, expected) |
| 78 | + |
| 79 | + s = Series([datetime(2013, 1, 1, 2, 32, 59), datetime(2013, 1, 2, 14, |
| 80 | +--- a/pandas/tseries/tests/test_timeseries.py |
| 81 | ++++ b/pandas/tseries/tests/test_timeseries.py |
| 82 | +@@ -2991,7 +2991,7 @@ class TestDatetimeIndex(tm.TestCase): |
| 83 | + |
| 84 | + f = lambda x: x.strftime('%Y%m%d') |
| 85 | + result = rng.map(f) |
| 86 | +- exp = np.array([f(x) for x in rng], dtype='<U8') |
| 87 | ++ exp = np.array([f(x) for x in rng], dtype='=U8') |
| 88 | + tm.assert_almost_equal(result, exp) |
| 89 | + |
| 90 | + def test_iteration_preserves_tz(self): |
0 commit comments