@@ -60,7 +60,7 @@ def create_data():
60
60
from pandas import (Series ,TimeSeries ,DataFrame ,Panel ,
61
61
SparseSeries ,SparseTimeSeries ,SparseDataFrame ,SparsePanel ,
62
62
Index ,MultiIndex ,PeriodIndex ,
63
- date_range ,period_range ,bdate_range ,Timestamp )
63
+ date_range ,period_range ,bdate_range ,Timestamp , Categorical )
64
64
nan = np .nan
65
65
66
66
data = {
@@ -85,7 +85,8 @@ def create_data():
85
85
mi = Series (np .arange (5 ).astype (np .float64 ),index = MultiIndex .from_tuples (tuple (zip (* [[1 ,1 ,2 ,2 ,2 ],
86
86
[3 ,4 ,3 ,4 ,5 ]])),
87
87
names = ['one' ,'two' ])),
88
- dup = Series (np .arange (5 ).astype (np .float64 ), index = ['A' , 'B' , 'C' , 'D' , 'A' ]))
88
+ dup = Series (np .arange (5 ).astype (np .float64 ), index = ['A' , 'B' , 'C' , 'D' , 'A' ]),
89
+ cat = Series (Categorical (['foo' , 'bar' , 'baz' ])))
89
90
90
91
frame = dict (float = DataFrame (dict (A = series ['float' ], B = series ['float' ] + 1 )),
91
92
int = DataFrame (dict (A = series ['int' ] , B = series ['int' ] + 1 )),
@@ -95,7 +96,11 @@ def create_data():
95
96
['one' ,'two' ,'one' ,'two' ,'three' ]])),
96
97
names = ['first' ,'second' ])),
97
98
dup = DataFrame (np .arange (15 ).reshape (5 , 3 ).astype (np .float64 ),
98
- columns = ['A' , 'B' , 'A' ]))
99
+ columns = ['A' , 'B' , 'A' ]),
100
+ cat_onecol = DataFrame (dict (A = Categorical (['foo' , 'bar' ]))),
101
+ cat_and_float = DataFrame (dict (A = Categorical (['foo' , 'bar' , 'baz' ]),
102
+ B = np .arange (3 ))),
103
+ )
99
104
panel = dict (float = Panel (dict (ItemA = frame ['float' ], ItemB = frame ['float' ]+ 1 )),
100
105
dup = Panel (np .arange (30 ).reshape (3 , 5 , 2 ).astype (np .float64 ),
101
106
items = ['A' , 'B' , 'A' ]))
0 commit comments