@@ -744,7 +744,7 @@ def append_to_multiple(self, d, value, selector, data_columns=None, axes=None, *
744744 dc = data_columns if k == selector else None
745745
746746 # compute the val
747- val = value .reindex_axis (v , axis = axis , copy = False )
747+ val = value .reindex_axis (v , axis = axis )
748748
749749 self .append (k , val , data_columns = dc , ** kwargs )
750750
@@ -2674,7 +2674,7 @@ def create_axes(self, axes, obj, validate=True, nan_rep=None, data_columns=None,
26742674
26752675 # reindex by our non_index_axes & compute data_columns
26762676 for a in self .non_index_axes :
2677- obj = obj .reindex_axis (a [1 ], axis = a [0 ], copy = False )
2677+ obj = obj .reindex_axis (a [1 ], axis = a [0 ])
26782678
26792679 # figure out data_columns and get out blocks
26802680 block_obj = self .get_object (obj ).consolidate ()
@@ -2684,10 +2684,10 @@ def create_axes(self, axes, obj, validate=True, nan_rep=None, data_columns=None,
26842684 data_columns = self .validate_data_columns (data_columns , min_itemsize )
26852685 if len (data_columns ):
26862686 blocks = block_obj .reindex_axis (Index (axis_labels ) - Index (
2687- data_columns ), axis = axis , copy = False )._data .blocks
2687+ data_columns ), axis = axis )._data .blocks
26882688 for c in data_columns :
26892689 blocks .extend (block_obj .reindex_axis (
2690- [c ], axis = axis , copy = False )._data .blocks )
2690+ [c ], axis = axis )._data .blocks )
26912691
26922692 # reorder the blocks in the same order as the existing_table if we can
26932693 if existing_table is not None :
@@ -2760,7 +2760,7 @@ def process_axes(self, obj, columns=None):
27602760 for axis , labels in self .non_index_axes :
27612761 if columns is not None :
27622762 labels = Index (labels ) & Index (columns )
2763- obj = obj .reindex_axis (labels , axis = axis , copy = False )
2763+ obj = obj .reindex_axis (labels , axis = axis )
27642764
27652765 # apply the selection filters (but keep in the same order)
27662766 if self .selection .filter :
@@ -3765,9 +3765,34 @@ def __init__(self, table, where=None, start=None, stop=None, **kwargs):
37653765 self .terms = None
37663766 self .coordinates = None
37673767
3768+ # a coordinate
37683769 if isinstance (where , Coordinates ):
37693770 self .coordinates = where .values
3770- else :
3771+
3772+ elif com .is_list_like (where ):
3773+
3774+ # see if we have a passed coordinate like
3775+ try :
3776+ inferred = lib .infer_dtype (where )
3777+ if inferred == 'integer' or inferred == 'boolean' :
3778+ where = np .array (where )
3779+ if where .dtype == np .bool_ :
3780+ start , stop = self .start , self .stop
3781+ if start is None :
3782+ start = 0
3783+ if stop is None :
3784+ stop = self .table .nrows
3785+ self .coordinates = np .arange (start ,stop )[where ]
3786+ elif issubclass (where .dtype .type ,np .integer ):
3787+ if (self .start is not None and (where < self .start ).any ()) or (self .stop is not None and (where >= self .stop ).any ()):
3788+ raise ValueError ("where must have index locations >= start and < stop" )
3789+ self .coordinates = where
3790+
3791+ except :
3792+ pass
3793+
3794+ if self .coordinates is None :
3795+
37713796 self .terms = self .generate (where )
37723797
37733798 # create the numexpr & the filter
0 commit comments