14
14
15
15
@pytest .fixture
16
16
def frame ():
17
+ """
18
+ Fixture for DataFrame of floats with index of unique strings
19
+
20
+ After completing the fixturization of the frame tests (GH 22471), this
21
+ fixture will be renamed to: float_frame_string_index
22
+
23
+ Columns are ['A', 'B', 'C', 'D'], see pandas.util.testing.getSeriesData
24
+ """
17
25
return DataFrame (tm .getSeriesData ())
18
26
19
27
20
28
@pytest .fixture
21
29
def frame2 ():
30
+ """
31
+ Fixture for DataFrame of floats with index of unique strings
32
+
33
+ After completing the fixturization of the frame tests (GH 22471), this
34
+ fixture will be renamed to: float_frame_string_index2
35
+
36
+ Columns are ['D', 'C', 'B', 'A']. See pandas.util.testing.getSeriesData
37
+ """
22
38
return DataFrame (tm .getSeriesData (), columns = ['D' , 'C' , 'B' , 'A' ])
23
39
24
40
25
41
@pytest .fixture
26
42
def intframe ():
43
+ """
44
+ Fixture for DataFrame of ints with index of unique strings
45
+
46
+ After completing the fixturization of the frame tests (GH 22471), this
47
+ fixture will be renamed to: int_frame
48
+
49
+ Columns are ['A', 'B', 'C', 'D']. See pandas.util.testing.getSeriesData
50
+ """
27
51
df = DataFrame ({k : v .astype (int )
28
52
for k , v in compat .iteritems (tm .getSeriesData ())})
29
53
# force these all to int64 to avoid platform testing issues
@@ -32,18 +56,43 @@ def intframe():
32
56
33
57
@pytest .fixture
34
58
def tsframe ():
59
+ """
60
+ Fixture for DataFrame of floats with DatetimeIndex
61
+
62
+ After completing the fixturization of the frame tests (GH 22471), this
63
+ fixture will be renamed to: float_frame_datetime_index
64
+
65
+ Columns are ['A', 'B', 'C', 'D']. See pandas.util.testing.getTimeSeriesData
66
+ """
35
67
return DataFrame (tm .getTimeSeriesData ())
36
68
37
69
38
70
@pytest .fixture
39
71
def mixed_frame ():
72
+ """
73
+ Fixture for DataFrame of floats and strings with string index
74
+
75
+ After completing the fixturization of the frame tests (GH 22471), this
76
+ fixture will be renamed to: float_string_frame
77
+
78
+ Columns are ['A', 'B', 'C', 'D', 'foo'].
79
+ See pandas.util.testing.getSeriesData
80
+ """
40
81
df = DataFrame (tm .getSeriesData ())
41
82
df ['foo' ] = 'bar'
42
83
return df
43
84
44
85
45
86
@pytest .fixture
46
87
def mixed_float ():
88
+ """
89
+ Fixture for DataFrame of different float types with string index
90
+
91
+ After completing the fixturization of the frame tests (GH 22471), this
92
+ fixture will be renamed to: mixed_float_frame
93
+
94
+ Columns are ['A', 'B', 'C', 'D']. See pandas.util.testing.getSeriesData
95
+ """
47
96
df = DataFrame (tm .getSeriesData ())
48
97
df .A = df .A .astype ('float16' )
49
98
df .B = df .B .astype ('float32' )
@@ -53,6 +102,14 @@ def mixed_float():
53
102
54
103
@pytest .fixture
55
104
def mixed_float2 ():
105
+ """
106
+ Fixture for DataFrame of different float types with string index
107
+
108
+ After completing the fixturization of the frame tests (GH 22471), this
109
+ fixture will be renamed to: mixed_float_frame2
110
+
111
+ Columns are ['A', 'B', 'C', 'D']. See pandas.util.testing.getSeriesData
112
+ """
56
113
df = DataFrame (tm .getSeriesData ())
57
114
df .D = df .D .astype ('float16' )
58
115
df .C = df .C .astype ('float32' )
@@ -62,6 +119,14 @@ def mixed_float2():
62
119
63
120
@pytest .fixture
64
121
def mixed_int ():
122
+ """
123
+ Fixture for DataFrame of different int types with string index
124
+
125
+ After completing the fixturization of the frame tests (GH 22471), this
126
+ fixture will be renamed to: mixed_int_frame
127
+
128
+ Columns are ['A', 'B', 'C', 'D']. See pandas.util.testing.getSeriesData
129
+ """
65
130
df = DataFrame ({k : v .astype (int )
66
131
for k , v in compat .iteritems (tm .getSeriesData ())})
67
132
df .A = df .A .astype ('uint8' )
@@ -73,6 +138,14 @@ def mixed_int():
73
138
74
139
@pytest .fixture
75
140
def all_mixed ():
141
+ """
142
+ Fixture for DataFrame of float/int/string columns
143
+
144
+ After completing the fixturization of the frame tests (GH 22471), this
145
+ fixture will be renamed to: float_int_string_frame
146
+
147
+ Columns are ['a', 'b', 'c', 'float32', 'int32'].
148
+ """
76
149
return DataFrame ({'a' : 1. , 'b' : 2 , 'c' : 'foo' ,
77
150
'float32' : np .array ([1. ] * 10 , dtype = 'float32' ),
78
151
'int32' : np .array ([1 ] * 10 , dtype = 'int32' )},
@@ -81,6 +154,14 @@ def all_mixed():
81
154
82
155
@pytest .fixture
83
156
def tzframe ():
157
+ """
158
+ Fixture for DataFrame of date_range Series with different timezones
159
+
160
+ After completing the fixturization of the frame tests (GH 22471), this
161
+ fixture will be renamed to: timezone_frame
162
+
163
+ Columns are ['A', 'B', 'C']; some entries are missing
164
+ """
84
165
df = DataFrame ({'A' : date_range ('20130101' , periods = 3 ),
85
166
'B' : date_range ('20130101' , periods = 3 ,
86
167
tz = 'US/Eastern' ),
@@ -93,21 +174,51 @@ def tzframe():
93
174
94
175
@pytest .fixture
95
176
def empty ():
177
+ """
178
+ Fixture for empty DataFrame
179
+
180
+ After completing the fixturization of the frame tests (GH 22471), this
181
+ fixture will be renamed to: empty_frame
182
+ """
96
183
return DataFrame ({})
97
184
98
185
99
186
@pytest .fixture
100
187
def ts1 ():
188
+ """
189
+ Fixture for Series of floats with DatetimeIndex
190
+
191
+ After completing the fixturization of the frame tests (GH 22471), this
192
+ fixture will be renamed to: datetime_series
193
+
194
+ See pandas.util.testing.makeTimeSeries
195
+ """
101
196
return tm .makeTimeSeries (nper = 30 )
102
197
103
198
104
199
@pytest .fixture
105
200
def ts2 ():
201
+ """
202
+ Fixture for Series of floats with DatetimeIndex
203
+
204
+ After completing the fixturization of the frame tests (GH 22471), this
205
+ fixture will be renamed to: datetime_series_short
206
+
207
+ See pandas.util.testing.makeTimeSeries
208
+ """
106
209
return tm .makeTimeSeries (nper = 30 )[5 :]
107
210
108
211
109
212
@pytest .fixture
110
213
def simple ():
214
+ """
215
+ Fixture for simple 3x3 DataFrame
216
+
217
+ After completing the fixturization of the frame tests (GH 22471), this
218
+ fixture will be renamed to: simple_frame
219
+
220
+ Columns are ['one', 'two', 'three'], index is ['a', 'b', 'c'].
221
+ """
111
222
arr = np .array ([[1. , 2. , 3. ],
112
223
[4. , 5. , 6. ],
113
224
[7. , 8. , 9. ]])
@@ -118,6 +229,12 @@ def simple():
118
229
119
230
@pytest .fixture
120
231
def frame_of_index_cols ():
232
+ """
233
+ Fixture for DataFrame of columns that can be used for indexing
234
+
235
+ Columns are ['A', 'B', 'C', 'D', 'E']; 'A' & 'B' contain duplicates,
236
+ the rest are unique.
237
+ """
121
238
df = DataFrame ({'A' : ['foo' , 'foo' , 'foo' , 'bar' , 'bar' ],
122
239
'B' : ['one' , 'two' , 'three' , 'one' , 'two' ],
123
240
'C' : ['a' , 'b' , 'c' , 'd' , 'e' ],
0 commit comments