File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -236,4 +236,31 @@ def time_getitem_bool_array(self, index):
236
236
self .data [self .data == self .cat_scalar ]
237
237
238
238
239
+ class Indexing (object ):
240
+
241
+ def setup (self ):
242
+ N = 10 ** 5
243
+ self .index = pd .CategoricalIndex (range (N ), range (N ))
244
+ self .series = pd .Series (range (N ), index = self .index ).sort_index ()
245
+ self .category = self .index [500 ]
246
+
247
+ def time_get_loc (self ):
248
+ self .index .get_loc (self .category )
249
+
250
+ def time_shape (self ):
251
+ self .index .shape
252
+
253
+ def time_shallow_copy (self ):
254
+ self .index ._shallow_copy ()
255
+
256
+ def time_align (self ):
257
+ df = pd .DataFrame ({'a' : self .series , 'b' : self .series [:500 ]})
258
+
259
+ def time_intersection (self ):
260
+ self .index [:750 ].intersection (self .index [250 :])
261
+
262
+ def time_unique (self ):
263
+ self .index .unique ()
264
+
265
+
239
266
from .pandas_vb_common import setup # noqa: F401
You can’t perform that action at this time.
0 commit comments