@@ -60,7 +60,7 @@ def create_data():
6060 from pandas import (Series ,TimeSeries ,DataFrame ,Panel ,
6161 SparseSeries ,SparseTimeSeries ,SparseDataFrame ,SparsePanel ,
6262 Index ,MultiIndex ,PeriodIndex ,
63- date_range ,period_range ,bdate_range ,Timestamp )
63+ date_range ,period_range ,bdate_range ,Timestamp , Categorical )
6464 nan = np .nan
6565
6666 data = {
@@ -85,7 +85,8 @@ def create_data():
8585 mi = Series (np .arange (5 ).astype (np .float64 ),index = MultiIndex .from_tuples (tuple (zip (* [[1 ,1 ,2 ,2 ,2 ],
8686 [3 ,4 ,3 ,4 ,5 ]])),
8787 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' ])))
8990
9091 frame = dict (float = DataFrame (dict (A = series ['float' ], B = series ['float' ] + 1 )),
9192 int = DataFrame (dict (A = series ['int' ] , B = series ['int' ] + 1 )),
@@ -95,7 +96,11 @@ def create_data():
9596 ['one' ,'two' ,'one' ,'two' ,'three' ]])),
9697 names = ['first' ,'second' ])),
9798 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+ )
99104 panel = dict (float = Panel (dict (ItemA = frame ['float' ], ItemB = frame ['float' ]+ 1 )),
100105 dup = Panel (np .arange (30 ).reshape (3 , 5 , 2 ).astype (np .float64 ),
101106 items = ['A' , 'B' , 'A' ]))
0 commit comments