Skip to content

Commit c538b3f

Browse files
committed
TST: dtype comparisons on windows, xref #10472
1 parent 6246cc1 commit c538b3f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pandas/tests/test_algos.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ def test_group_var_generic_1d(self):
294294
prng = RandomState(1234)
295295

296296
out = (np.nan * np.ones((5, 1))).astype(self.dtype)
297-
counts = np.zeros(5, dtype=int)
297+
counts = np.zeros(5, dtype='int64')
298298
values = 10 * prng.rand(15, 1).astype(self.dtype)
299-
labels = np.tile(np.arange(5), (3, ))
299+
labels = np.tile(np.arange(5), (3, )).astype('int64')
300300

301301
expected_out = (np.squeeze(values)
302302
.reshape((5, 3), order='F')
@@ -311,9 +311,9 @@ def test_group_var_generic_1d_flat_labels(self):
311311
prng = RandomState(1234)
312312

313313
out = (np.nan * np.ones((1, 1))).astype(self.dtype)
314-
counts = np.zeros(1, dtype=int)
314+
counts = np.zeros(1, dtype='int64')
315315
values = 10 * prng.rand(5, 1).astype(self.dtype)
316-
labels = np.zeros(5, dtype=int)
316+
labels = np.zeros(5, dtype='int64')
317317

318318
expected_out = np.array([[values.std(ddof=1) ** 2]])
319319
expected_counts = counts + 5
@@ -327,9 +327,9 @@ def test_group_var_generic_2d_all_finite(self):
327327
prng = RandomState(1234)
328328

329329
out = (np.nan * np.ones((5, 2))).astype(self.dtype)
330-
counts = np.zeros(5, dtype=int)
330+
counts = np.zeros(5, dtype='int64')
331331
values = 10 * prng.rand(10, 2).astype(self.dtype)
332-
labels = np.tile(np.arange(5), (2, ))
332+
labels = np.tile(np.arange(5), (2, )).astype('int64')
333333

334334
expected_out = np.std(
335335
values.reshape(2, 5, 2), ddof=1, axis=0) ** 2
@@ -343,10 +343,10 @@ def test_group_var_generic_2d_some_nan(self):
343343
prng = RandomState(1234)
344344

345345
out = (np.nan * np.ones((5, 2))).astype(self.dtype)
346-
counts = np.zeros(5, dtype=int)
346+
counts = np.zeros(5, dtype='int64')
347347
values = 10 * prng.rand(10, 2).astype(self.dtype)
348348
values[:, 1] = np.nan
349-
labels = np.tile(np.arange(5), (2, ))
349+
labels = np.tile(np.arange(5), (2, )).astype('int64')
350350

351351
expected_out = np.vstack([
352352
values[:, 0].reshape(5, 2, order='F').std(ddof=1, axis=1) ** 2,
@@ -362,9 +362,9 @@ def test_group_var_constant(self):
362362
# Regression test from GH 10448.
363363

364364
out = np.array([[np.nan]], dtype=self.dtype)
365-
counts = np.array([0])
365+
counts = np.array([0],dtype='int64')
366366
values = 0.832845131556193 * np.ones((3, 1), dtype=self.dtype)
367-
labels = np.zeros(3, dtype=np.int)
367+
labels = np.zeros(3, dtype='int64')
368368

369369
self.algo(out, counts, values, labels)
370370

@@ -386,10 +386,10 @@ def test_group_var_large_inputs(self):
386386
prng = RandomState(1234)
387387

388388
out = np.array([[np.nan]], dtype=self.dtype)
389-
counts = np.array([0])
389+
counts = np.array([0],dtype='int64')
390390
values = (prng.rand(10 ** 6) + 10 ** 12).astype(self.dtype)
391391
values.shape = (10 ** 6, 1)
392-
labels = np.zeros(10 ** 6, dtype=np.int)
392+
labels = np.zeros(10 ** 6, dtype='int64')
393393

394394
self.algo(out, counts, values, labels)
395395

0 commit comments

Comments
 (0)