Skip to content

Commit 5551bcf

Browse files
h-vetinarijreback
authored andcommitted
TST/CLN: Fixturize frame/test_analytics (pandas-dev#22733)
1 parent d523d9f commit 5551bcf

File tree

2 files changed

+390
-358
lines changed

2 files changed

+390
-358
lines changed

pandas/tests/frame/conftest.py

+29
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ def float_frame():
1717
return DataFrame(tm.getSeriesData())
1818

1919

20+
@pytest.fixture
21+
def float_frame_with_na():
22+
"""
23+
Fixture for DataFrame of floats with index of unique strings
24+
25+
Columns are ['A', 'B', 'C', 'D']; some entries are missing
26+
"""
27+
df = DataFrame(tm.getSeriesData())
28+
# set some NAs
29+
df.loc[5:10] = np.nan
30+
df.loc[15:20, -2:] = np.nan
31+
return df
32+
33+
2034
@pytest.fixture
2135
def float_frame2():
2236
"""
@@ -27,6 +41,21 @@ def float_frame2():
2741
return DataFrame(tm.getSeriesData(), columns=['D', 'C', 'B', 'A'])
2842

2943

44+
@pytest.fixture
45+
def bool_frame_with_na():
46+
"""
47+
Fixture for DataFrame of booleans with index of unique strings
48+
49+
Columns are ['A', 'B', 'C', 'D']; some entries are missing
50+
"""
51+
df = DataFrame(tm.getSeriesData()) > 0
52+
df = df.astype(object)
53+
# set some NAs
54+
df.loc[5:10] = np.nan
55+
df.loc[15:20, -2:] = np.nan
56+
return df
57+
58+
3059
@pytest.fixture
3160
def int_frame():
3261
"""

0 commit comments

Comments
 (0)