@@ -744,7 +744,7 @@ def append_to_multiple(self, d, value, selector, data_columns=None, axes=None, *
744
744
dc = data_columns if k == selector else None
745
745
746
746
# compute the val
747
- val = value .reindex_axis (v , axis = axis , copy = False )
747
+ val = value .reindex_axis (v , axis = axis )
748
748
749
749
self .append (k , val , data_columns = dc , ** kwargs )
750
750
@@ -2674,7 +2674,7 @@ def create_axes(self, axes, obj, validate=True, nan_rep=None, data_columns=None,
2674
2674
2675
2675
# reindex by our non_index_axes & compute data_columns
2676
2676
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 ])
2678
2678
2679
2679
# figure out data_columns and get out blocks
2680
2680
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,
2684
2684
data_columns = self .validate_data_columns (data_columns , min_itemsize )
2685
2685
if len (data_columns ):
2686
2686
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
2688
2688
for c in data_columns :
2689
2689
blocks .extend (block_obj .reindex_axis (
2690
- [c ], axis = axis , copy = False )._data .blocks )
2690
+ [c ], axis = axis )._data .blocks )
2691
2691
2692
2692
# reorder the blocks in the same order as the existing_table if we can
2693
2693
if existing_table is not None :
@@ -2760,7 +2760,7 @@ def process_axes(self, obj, columns=None):
2760
2760
for axis , labels in self .non_index_axes :
2761
2761
if columns is not None :
2762
2762
labels = Index (labels ) & Index (columns )
2763
- obj = obj .reindex_axis (labels , axis = axis , copy = False )
2763
+ obj = obj .reindex_axis (labels , axis = axis )
2764
2764
2765
2765
# apply the selection filters (but keep in the same order)
2766
2766
if self .selection .filter :
@@ -3765,9 +3765,34 @@ def __init__(self, table, where=None, start=None, stop=None, **kwargs):
3765
3765
self .terms = None
3766
3766
self .coordinates = None
3767
3767
3768
+ # a coordinate
3768
3769
if isinstance (where , Coordinates ):
3769
3770
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
+
3771
3796
self .terms = self .generate (where )
3772
3797
3773
3798
# create the numexpr & the filter
0 commit comments