changed readArray default behavior to reading always scalars when columns are referenced by number
This commit is contained in:
parent
b15f68905f
commit
08f4495721
|
@ -341,8 +341,10 @@ class ASCIItable():
|
||||||
labels_missing = np.array(labels)[missing] # labels of missing data
|
labels_missing = np.array(labels)[missing] # labels of missing data
|
||||||
|
|
||||||
columns = []
|
columns = []
|
||||||
for c in indices[present]: # for all valid labels ...
|
for i,c in enumerate(indices[present]): # for all valid labels ...
|
||||||
columns += range(c,c+self.label_dimension(c)) # ... transparently add all components
|
columns += range(c,c + \
|
||||||
|
(self.label_dimension(c) if str(c) != str(labels[present[i]]) \
|
||||||
|
else 1)) # ... transparently add all components unless column referenced by number
|
||||||
use = np.array(columns)
|
use = np.array(columns)
|
||||||
|
|
||||||
self.labels = list(np.array(self.labels)[use]) if use != [] else [] # ... for missing and present columns
|
self.labels = list(np.array(self.labels)[use]) if use != [] else [] # ... for missing and present columns
|
||||||
|
|
Loading…
Reference in New Issue