Skip to content

Commit 250412e

Browse files
author
Trevor Bye
committed
moved tests
1 parent 76c0f8a commit 250412e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+36
-41
lines changed

__0NsxkJp1fk__.pickle

578 Bytes
Binary file not shown.

__1BHvYOXA1y__.pickle

130 Bytes
Binary file not shown.

__1HzwAA0tiR__.pickle

94 Bytes
Binary file not shown.

__29OcRI4Ooz__.pickle

192 Bytes
Binary file not shown.

__2gQvHqh5QF__.pickle

4.78 KB
Binary file not shown.

__3ybaG3MODv__.pickle

1.39 KB
Binary file not shown.

__4t08aOjP1F__.pickle

194 Bytes
Binary file not shown.

__5iED0rELS8__.pickle

192 Bytes
Binary file not shown.

__7429769X1C__.pickle

1.5 KB
Binary file not shown.

__7BVLK2nVWx__.pickle

2.58 KB
Binary file not shown.

__7MiBOWODuq__.pickle

1.21 KB
Binary file not shown.

__CTRvSZJf5f__.pickle

2.19 KB
Binary file not shown.

__CadXR7Zuva__.pickle

668 Bytes
Binary file not shown.

__Cs6b4DreSI__.pickle

1.21 KB
Binary file not shown.

__DlWem70t81__.pickle

966 Bytes
Binary file not shown.

__DogUpp5BVX__.pickle

312 Bytes
Binary file not shown.

__E4LZ18PyMM__.pickle

187 Bytes
Binary file not shown.

__EftgdSwA1n__.pickle

1.24 KB
Binary file not shown.

__G08X3MP0ge__.pickle

1.23 KB
Binary file not shown.

__GAZlIGIw91__.pickle

985 Bytes
Binary file not shown.

__GLQDVO1Vgt__.pickle

747 Bytes
Binary file not shown.

__IM5JAQvvms__.pickle

243 Bytes
Binary file not shown.

__JH10UtDOCu__.pickle

5.57 KB
Binary file not shown.

__JvvWmhb7MJ__.pickle

123 KB
Binary file not shown.

__KTrd6E8IJr__.pickle

1.04 KB
Binary file not shown.

__LIufXp4jgZ__.pickle

3 KB
Binary file not shown.

__MS3NWdOoMq__.pickle

187 Bytes
Binary file not shown.

__N2BS1MXDFV__.pickle

192 Bytes
Binary file not shown.

__PE8nOCkIyC__.pickle

219 Bytes
Binary file not shown.

__QNCR8rtFYc__.pickle

465 Bytes
Binary file not shown.

__RQ9ZLFSCxw__.pickle

2.15 KB
Binary file not shown.

__Rpu0VvyX7I__.pickle

1.98 KB
Binary file not shown.

__SMcfjNCH5J__.pickle

442 Bytes
Binary file not shown.

__Un2BZzRIXB__.pickle

959 Bytes
Binary file not shown.

__Viu19FRLJP__.pickle

506 Bytes
Binary file not shown.

__XOj8lfU1vX__.pickle

155 Bytes
Binary file not shown.

__YuILvz4NuL__.pickle

194 Bytes
Binary file not shown.

__ZXsHzOY4tM__.pickle

194 Bytes
Binary file not shown.

__a3DvIelL7W__.pickle

230 Bytes
Binary file not shown.

__aBqPYIoExv__.pickle

474 Bytes
Binary file not shown.

__aHADUZeR0u__.pickle

2.53 KB
Binary file not shown.

__bcFokS27f6__.pickle

71 Bytes
Binary file not shown.

__clQJFHtNvP__.pickle

604 Bytes
Binary file not shown.

__hw9zaOU3Ul__.pickle

66 Bytes
Binary file not shown.

__iCPw9HKMl5__.pickle

131 Bytes
Binary file not shown.

__lmbi30GVD0__.pickle

530 Bytes
Binary file not shown.

__mZjhkqmTsQ__.pickle

1.33 KB
Binary file not shown.

__p6CtCWBfWW__.pickle

945 Bytes
Binary file not shown.

__pQprudtuwR__.pickle

615 Bytes
Binary file not shown.

__pR9elo4XdC__.pickle

234 Bytes
Binary file not shown.

__qNoXczCBrS__.pickle

1.04 KB
Binary file not shown.

__qx0096s48h__.pickle

513 Bytes
Binary file not shown.

__s7Jjycos1U__.pickle

131 Bytes
Binary file not shown.

__sDNpOas8uf__.pickle

596 Bytes
Binary file not shown.

__sjoaB7AJMg__.pickle

642 Bytes
Binary file not shown.

__t8xTCRoAdO__.pickle

146 Bytes
Binary file not shown.

__tL6qFKQMSb__.pickle

397 Bytes
Binary file not shown.

__ukgGWSwucy__.pickle

336 Bytes
Binary file not shown.

__w5LQ8aYO0M__.pickle

187 Bytes
Binary file not shown.

__wXACLjjAMU__.pickle

586 Bytes
Binary file not shown.

__y6RzVtuYSn__.pickle

1.04 KB
Binary file not shown.

__zOC7Cr16dR__.pickle

1.38 KB
Binary file not shown.

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4496,7 +4496,7 @@ class max type
44964496

44974497
def _maybe_casted_values(index, labels=None):
44984498
values = index._values
4499-
4499+
45004500
# if we have the labels, extract the values with a mask
45014501
if labels is not None:
45024502
mask = labels == -1

pandas/tests/frame/test_alter_axes.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,41 @@ def test_droplevel(self):
14681468
result = df.droplevel("level_2", axis="columns")
14691469
tm.assert_frame_equal(result, expected)
14701470

1471+
@pytest.mark.parametrize('test_dtype', [object, 'int64'])
1472+
def test_dtypes(self, test_dtype):
1473+
df = DataFrame({'A': Series([1, 2, 3], dtype=test_dtype), 'B': [1, 2, 3]})
1474+
expected = df.dtypes.values[0].type
1475+
1476+
result = df.set_index('A').index.dtype.type
1477+
assert result == expected
1478+
1479+
@pytest.fixture
1480+
def mixed_series(self):
1481+
return Series([1, 2, 3, 'apple', 'corn'], dtype=object)
1482+
1483+
@pytest.fixture
1484+
def int_series(self):
1485+
return Series([100, 200, 300, 400, 500])
1486+
1487+
def test_dtypes_between_queries(self, mixed_series, int_series):
1488+
df = DataFrame({'item': mixed_series, 'cost': int_series})
1489+
1490+
orig_dtypes = df.dtypes
1491+
item_dtype = orig_dtypes.get('item').type
1492+
cost_dtype = orig_dtypes.get('cost').type
1493+
expected = {'item': item_dtype, 'cost': cost_dtype}
1494+
1495+
# after applying a query that would remove strings from the 'item' series with
1496+
# dtype: object, that series should remain as dtype: object as it becomes an
1497+
# index, and again as it becomes a column again after calling reset_index()
1498+
dtypes_transformed = df.query('cost < 400').set_index(
1499+
'item').reset_index().dtypes
1500+
item_dtype_transformed = dtypes_transformed.get('item').type
1501+
cost_dtype_transformed = dtypes_transformed.get('cost').type
1502+
result = {'item': item_dtype_transformed, 'cost': cost_dtype_transformed}
1503+
1504+
assert result == expected
1505+
14711506

14721507
class TestIntervalIndex:
14731508
def test_setitem(self):

pandas/tests/frame/test_set_index_preserve_dtype.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)