Skip to content

Commit 0699c89

Browse files
yarikopticjreback
authored andcommitted
BF(TST): use = (native) instead of < (little endian) for target data types (#14832)
1 parent 36bb8af commit 0699c89

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

pandas/io/tests/parser/common.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ def test_as_recarray(self):
14531453
FutureWarning, check_stacklevel=False):
14541454
data = 'a,b\n1,a\n2,b'
14551455
expected = np.array([(1, 'a'), (2, 'b')],
1456-
dtype=[('a', '<i8'), ('b', 'O')])
1456+
dtype=[('a', '=i8'), ('b', 'O')])
14571457
out = self.read_csv(StringIO(data), as_recarray=True)
14581458
tm.assert_numpy_array_equal(out, expected)
14591459

@@ -1462,7 +1462,7 @@ def test_as_recarray(self):
14621462
FutureWarning, check_stacklevel=False):
14631463
data = 'a,b\n1,a\n2,b'
14641464
expected = np.array([(1, 'a'), (2, 'b')],
1465-
dtype=[('a', '<i8'), ('b', 'O')])
1465+
dtype=[('a', '=i8'), ('b', 'O')])
14661466
out = self.read_csv(StringIO(data), as_recarray=True, index_col=0)
14671467
tm.assert_numpy_array_equal(out, expected)
14681468

@@ -1471,7 +1471,7 @@ def test_as_recarray(self):
14711471
FutureWarning, check_stacklevel=False):
14721472
data = '1,a\n2,b'
14731473
expected = np.array([(1, 'a'), (2, 'b')],
1474-
dtype=[('a', '<i8'), ('b', 'O')])
1474+
dtype=[('a', '=i8'), ('b', 'O')])
14751475
out = self.read_csv(StringIO(data), names=['a', 'b'],
14761476
header=None, as_recarray=True)
14771477
tm.assert_numpy_array_equal(out, expected)
@@ -1482,15 +1482,15 @@ def test_as_recarray(self):
14821482
FutureWarning, check_stacklevel=False):
14831483
data = 'b,a\n1,a\n2,b'
14841484
expected = np.array([(1, 'a'), (2, 'b')],
1485-
dtype=[('b', '<i8'), ('a', 'O')])
1485+
dtype=[('b', '=i8'), ('a', 'O')])
14861486
out = self.read_csv(StringIO(data), as_recarray=True)
14871487
tm.assert_numpy_array_equal(out, expected)
14881488

14891489
# overrides the squeeze parameter
14901490
with tm.assert_produces_warning(
14911491
FutureWarning, check_stacklevel=False):
14921492
data = 'a\n1'
1493-
expected = np.array([(1,)], dtype=[('a', '<i8')])
1493+
expected = np.array([(1,)], dtype=[('a', '=i8')])
14941494
out = self.read_csv(StringIO(data), as_recarray=True, squeeze=True)
14951495
tm.assert_numpy_array_equal(out, expected)
14961496

@@ -1500,7 +1500,7 @@ def test_as_recarray(self):
15001500
data = 'a,b\n1,a\n2,b'
15011501
conv = lambda x: int(x) + 1
15021502
expected = np.array([(2, 'a'), (3, 'b')],
1503-
dtype=[('a', '<i8'), ('b', 'O')])
1503+
dtype=[('a', '=i8'), ('b', 'O')])
15041504
out = self.read_csv(StringIO(data), as_recarray=True,
15051505
converters={'a': conv})
15061506
tm.assert_numpy_array_equal(out, expected)
@@ -1509,7 +1509,7 @@ def test_as_recarray(self):
15091509
with tm.assert_produces_warning(
15101510
FutureWarning, check_stacklevel=False):
15111511
data = 'a,b\n1,a\n2,b'
1512-
expected = np.array([(1,), (2,)], dtype=[('a', '<i8')])
1512+
expected = np.array([(1,), (2,)], dtype=[('a', '=i8')])
15131513
out = self.read_csv(StringIO(data), as_recarray=True,
15141514
usecols=['a'])
15151515
tm.assert_numpy_array_equal(out, expected)

pandas/tests/series/test_datetime_values.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def test_strftime(self):
326326
period_index = period_range('20150301', periods=5)
327327
result = period_index.strftime("%Y/%m/%d")
328328
expected = np.array(['2015/03/01', '2015/03/02', '2015/03/03',
329-
'2015/03/04', '2015/03/05'], dtype='<U10')
329+
'2015/03/04', '2015/03/05'], dtype='=U10')
330330
self.assert_numpy_array_equal(result, expected)
331331

332332
s = Series([datetime(2013, 1, 1, 2, 32, 59), datetime(2013, 1, 2, 14,

pandas/tseries/tests/test_timeseries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2991,7 +2991,7 @@ def test_map(self):
29912991

29922992
f = lambda x: x.strftime('%Y%m%d')
29932993
result = rng.map(f)
2994-
exp = np.array([f(x) for x in rng], dtype='<U8')
2994+
exp = np.array([f(x) for x in rng], dtype='=U8')
29952995
tm.assert_almost_equal(result, exp)
29962996

29972997
def test_iteration_preserves_tz(self):

0 commit comments

Comments
 (0)