@@ -142,16 +142,16 @@ def create_data():
142
142
"E" : [0.0 , 1 , Timestamp ("20100101" ), "foo" , 2.0 ],
143
143
}
144
144
145
- scalars = dict ( timestamp = Timestamp ("20130101" ), period = Period ("2012" , "M" ))
146
-
147
- index = dict (
148
- int = Index (np .arange (10 )),
149
- date = date_range ("20130101" , periods = 10 ),
150
- period = period_range ("2013-01-01" , freq = "M" , periods = 10 ),
151
- float = Index (np .arange (10 , dtype = np .float64 )),
152
- uint = Index (np .arange (10 , dtype = np .uint64 )),
153
- timedelta = timedelta_range ("00:00:00" , freq = "30T" , periods = 10 ),
154
- )
145
+ scalars = { " timestamp" : Timestamp ("20130101" ), " period" : Period ("2012" , "M" )}
146
+
147
+ index = {
148
+ " int" : Index (np .arange (10 )),
149
+ " date" : date_range ("20130101" , periods = 10 ),
150
+ " period" : period_range ("2013-01-01" , freq = "M" , periods = 10 ),
151
+ " float" : Index (np .arange (10 , dtype = np .float64 )),
152
+ " uint" : Index (np .arange (10 , dtype = np .uint64 )),
153
+ " timedelta" : timedelta_range ("00:00:00" , freq = "30T" , periods = 10 ),
154
+ }
155
155
156
156
index ["range" ] = RangeIndex (10 )
157
157
@@ -160,8 +160,8 @@ def create_data():
160
160
161
161
index ["interval" ] = interval_range (0 , periods = 10 )
162
162
163
- mi = dict (
164
- reg2 = MultiIndex .from_tuples (
163
+ mi = {
164
+ " reg2" : MultiIndex .from_tuples (
165
165
tuple (
166
166
zip (
167
167
* [
@@ -172,35 +172,35 @@ def create_data():
172
172
),
173
173
names = ["first" , "second" ],
174
174
)
175
- )
175
+ }
176
176
177
- series = dict (
178
- float = Series (data ["A" ]),
179
- int = Series (data ["B" ]),
180
- mixed = Series (data ["E" ]),
181
- ts = Series (
177
+ series = {
178
+ " float" : Series (data ["A" ]),
179
+ " int" : Series (data ["B" ]),
180
+ " mixed" : Series (data ["E" ]),
181
+ "ts" : Series (
182
182
np .arange (10 ).astype (np .int64 ), index = date_range ("20130101" , periods = 10 )
183
183
),
184
- mi = Series (
184
+ "mi" : Series (
185
185
np .arange (5 ).astype (np .float64 ),
186
186
index = MultiIndex .from_tuples (
187
187
tuple (zip (* [[1 , 1 , 2 , 2 , 2 ], [3 , 4 , 3 , 4 , 5 ]])), names = ["one" , "two" ]
188
188
),
189
189
),
190
- dup = Series (np .arange (5 ).astype (np .float64 ), index = ["A" , "B" , "C" , "D" , "A" ]),
191
- cat = Series (Categorical (["foo" , "bar" , "baz" ])),
192
- dt = Series (date_range ("20130101" , periods = 5 )),
193
- dt_tz = Series (date_range ("20130101" , periods = 5 , tz = "US/Eastern" )),
194
- period = Series ([Period ("2000Q1" )] * 5 ),
195
- )
190
+ " dup" : Series (np .arange (5 ).astype (np .float64 ), index = ["A" , "B" , "C" , "D" , "A" ]),
191
+ " cat" : Series (Categorical (["foo" , "bar" , "baz" ])),
192
+ "dt" : Series (date_range ("20130101" , periods = 5 )),
193
+ " dt_tz" : Series (date_range ("20130101" , periods = 5 , tz = "US/Eastern" )),
194
+ " period" : Series ([Period ("2000Q1" )] * 5 ),
195
+ }
196
196
197
197
mixed_dup_df = DataFrame (data )
198
198
mixed_dup_df .columns = list ("ABCDA" )
199
- frame = dict (
200
- float = DataFrame ({"A" : series ["float" ], "B" : series ["float" ] + 1 }),
201
- int = DataFrame ({"A" : series ["int" ], "B" : series ["int" ] + 1 }),
202
- mixed = DataFrame ({k : data [k ] for k in ["A" , "B" , "C" , "D" ]}),
203
- mi = DataFrame (
199
+ frame = {
200
+ " float" : DataFrame ({"A" : series ["float" ], "B" : series ["float" ] + 1 }),
201
+ " int" : DataFrame ({"A" : series ["int" ], "B" : series ["int" ] + 1 }),
202
+ " mixed" : DataFrame ({k : data [k ] for k in ["A" , "B" , "C" , "D" ]}),
203
+ "mi" : DataFrame (
204
204
{"A" : np .arange (5 ).astype (np .float64 ), "B" : np .arange (5 ).astype (np .int64 )},
205
205
index = MultiIndex .from_tuples (
206
206
tuple (
@@ -214,45 +214,45 @@ def create_data():
214
214
names = ["first" , "second" ],
215
215
),
216
216
),
217
- dup = DataFrame (
217
+ " dup" : DataFrame (
218
218
np .arange (15 ).reshape (5 , 3 ).astype (np .float64 ), columns = ["A" , "B" , "A" ]
219
219
),
220
- cat_onecol = DataFrame ({"A" : Categorical (["foo" , "bar" ])}),
221
- cat_and_float = DataFrame (
220
+ " cat_onecol" : DataFrame ({"A" : Categorical (["foo" , "bar" ])}),
221
+ " cat_and_float" : DataFrame (
222
222
{
223
223
"A" : Categorical (["foo" , "bar" , "baz" ]),
224
224
"B" : np .arange (3 ).astype (np .int64 ),
225
225
}
226
226
),
227
- mixed_dup = mixed_dup_df ,
228
- dt_mixed_tzs = DataFrame (
227
+ " mixed_dup" : mixed_dup_df ,
228
+ " dt_mixed_tzs" : DataFrame (
229
229
{
230
230
"A" : Timestamp ("20130102" , tz = "US/Eastern" ),
231
231
"B" : Timestamp ("20130603" , tz = "CET" ),
232
232
},
233
233
index = range (5 ),
234
234
),
235
- dt_mixed2_tzs = DataFrame (
235
+ " dt_mixed2_tzs" : DataFrame (
236
236
{
237
237
"A" : Timestamp ("20130102" , tz = "US/Eastern" ),
238
238
"B" : Timestamp ("20130603" , tz = "CET" ),
239
239
"C" : Timestamp ("20130603" , tz = "UTC" ),
240
240
},
241
241
index = range (5 ),
242
242
),
243
- )
243
+ }
244
244
245
- cat = dict (
246
- int8 = Categorical (list ("abcdefg" )),
247
- int16 = Categorical (np .arange (1000 )),
248
- int32 = Categorical (np .arange (10000 )),
249
- )
245
+ cat = {
246
+ " int8" : Categorical (list ("abcdefg" )),
247
+ " int16" : Categorical (np .arange (1000 )),
248
+ " int32" : Categorical (np .arange (10000 )),
249
+ }
250
250
251
- timestamp = dict (
252
- normal = Timestamp ("2011-01-01" ),
253
- nat = NaT ,
254
- tz = Timestamp ("2011-01-01" , tz = "US/Eastern" ),
255
- )
251
+ timestamp = {
252
+ " normal" : Timestamp ("2011-01-01" ),
253
+ " nat" : NaT ,
254
+ "tz" : Timestamp ("2011-01-01" , tz = "US/Eastern" ),
255
+ }
256
256
257
257
timestamp ["freq" ] = Timestamp ("2011-01-01" , freq = "D" )
258
258
timestamp ["both" ] = Timestamp ("2011-01-01" , tz = "Asia/Tokyo" , freq = "M" )
@@ -282,18 +282,18 @@ def create_data():
282
282
"Minute" : Minute (1 ),
283
283
}
284
284
285
- return dict (
286
- series = series ,
287
- frame = frame ,
288
- index = index ,
289
- scalars = scalars ,
290
- mi = mi ,
291
- sp_series = dict ( float = _create_sp_series (), ts = _create_sp_tsseries ()) ,
292
- sp_frame = dict ( float = _create_sp_frame ()) ,
293
- cat = cat ,
294
- timestamp = timestamp ,
295
- offsets = off ,
296
- )
285
+ return {
286
+ " series" : series ,
287
+ " frame" : frame ,
288
+ " index" : index ,
289
+ " scalars" : scalars ,
290
+ "mi" : mi ,
291
+ " sp_series" : { " float" : _create_sp_series (), "ts" : _create_sp_tsseries ()} ,
292
+ " sp_frame" : { " float" : _create_sp_frame ()} ,
293
+ " cat" : cat ,
294
+ " timestamp" : timestamp ,
295
+ " offsets" : off ,
296
+ }
297
297
298
298
299
299
def create_pickle_data ():
0 commit comments