@@ -133,7 +133,8 @@ def create_pickle_data():
133
133
data = {
134
134
"A" : [0.0 , 1.0 , 2.0 , 3.0 , np .nan ],
135
135
"B" : [0 , 1 , 0 , 1 , 0 ],
136
- "C" : ["foo1" , "foo2" , "foo3" , "foo4" , "foo5" ],
136
+ # "C": ["foo1", "foo2", "foo3", "foo4", "foo5"],
137
+ "C" : Series (["foo1" , "foo2" , "foo3" , "foo4" , "foo5" ], dtype = object ),
137
138
"D" : date_range ("1/1/2009" , periods = 5 ),
138
139
"E" : [0.0 , 1 , Timestamp ("20100101" ), "foo" , 2.0 ],
139
140
}
@@ -180,8 +181,16 @@ def create_pickle_data():
180
181
tuple (zip (* [[1 , 1 , 2 , 2 , 2 ], [3 , 4 , 3 , 4 , 5 ]])), names = ["one" , "two" ]
181
182
),
182
183
),
183
- "dup" : Series (np .arange (5 ).astype (np .float64 ), index = ["A" , "B" , "C" , "D" , "A" ]),
184
- "cat" : Series (Categorical (["foo" , "bar" , "baz" ])),
184
+ "dup" : Series (
185
+ np .arange (5 ).astype (np .float64 ),
186
+ index = Index (["A" , "B" , "C" , "D" , "A" ], dtype = object ),
187
+ ),
188
+ # "cat": Series(Categorical(["foo", "bar", "baz"])),
189
+ "cat" : Series (
190
+ Categorical .from_codes (
191
+ [2 , 0 , 1 ], categories = Index (["bar" , "baz" , "foo" ], dtype = "object" )
192
+ )
193
+ ),
185
194
"dt" : Series (date_range ("20130101" , periods = 5 )),
186
195
"dt_tz" : Series (date_range ("20130101" , periods = 5 , tz = "US/Eastern" )),
187
196
"period" : Series ([Period ("2000Q1" )] * 5 ),
@@ -210,26 +219,36 @@ def create_pickle_data():
210
219
"dup" : DataFrame (
211
220
np .arange (15 ).reshape (5 , 3 ).astype (np .float64 ), columns = ["A" , "B" , "A" ]
212
221
),
213
- "cat_onecol" : DataFrame ({"A" : Categorical (["foo" , "bar" ])}),
222
+ # "cat_onecol": DataFrame({"A": Categorical(["foo", "bar"])}),
223
+ "cat_onecol" : DataFrame (
224
+ {
225
+ "A" : Categorical .from_codes (
226
+ [1 , 0 ], categories = Index (["bar" , "foo" ], dtype = "object" )
227
+ )
228
+ }
229
+ ),
214
230
"cat_and_float" : DataFrame (
215
231
{
216
- "A" : Categorical (["foo" , "bar" , "baz" ]),
232
+ # "A": Categorical(["foo", "bar", "baz"]),
233
+ "A" : Categorical .from_codes (
234
+ [2 , 0 , 1 ], categories = Index (["bar" , "baz" , "foo" ], dtype = "object" )
235
+ ),
217
236
"B" : np .arange (3 ).astype (np .int64 ),
218
237
}
219
238
),
220
239
"mixed_dup" : mixed_dup_df ,
221
240
"dt_mixed_tzs" : DataFrame (
222
241
{
223
- "A" : Timestamp ("20130102" , tz = "US/Eastern" ),
224
- "B" : Timestamp ("20130603" , tz = "CET" ),
242
+ "A" : Timestamp ("20130102" , tz = "US/Eastern" ). as_unit ( "ns" ) ,
243
+ "B" : Timestamp ("20130603" , tz = "CET" ). as_unit ( "ns" ) ,
225
244
},
226
245
index = range (5 ),
227
246
),
228
247
"dt_mixed2_tzs" : DataFrame (
229
248
{
230
- "A" : Timestamp ("20130102" , tz = "US/Eastern" ),
231
- "B" : Timestamp ("20130603" , tz = "CET" ),
232
- "C" : Timestamp ("20130603" , tz = "UTC" ),
249
+ "A" : Timestamp ("20130102" , tz = "US/Eastern" ). as_unit ( "ns" ) ,
250
+ "B" : Timestamp ("20130603" , tz = "CET" ). as_unit ( "ns" ) ,
251
+ "C" : Timestamp ("20130603" , tz = "UTC" ). as_unit ( "ns" ) ,
233
252
},
234
253
index = range (5 ),
235
254
),
@@ -245,6 +264,9 @@ def create_pickle_data():
245
264
"normal" : Timestamp ("2011-01-01" ),
246
265
"nat" : NaT ,
247
266
"tz" : Timestamp ("2011-01-01" , tz = "US/Eastern" ),
267
+ # kept because those are present in the legacy pickles (<= 1.4)
268
+ "freq" : Timestamp ("2011-01-01" ),
269
+ "both" : Timestamp ("2011-01-01" , tz = "Asia/Tokyo" ),
248
270
}
249
271
250
272
off = {
0 commit comments