fixed problem when reading single label through data_readArray
This commit is contained in:
parent
681b7f0831
commit
7ceb7f7614
|
@ -416,6 +416,7 @@ class ASCIItable():
|
|||
'''
|
||||
read whole data of all (given) labels as numpy array
|
||||
'''
|
||||
from collections import Iterable
|
||||
|
||||
try:
|
||||
self.data_rewind() # try to wind back to start of data
|
||||
|
@ -426,6 +427,8 @@ class ASCIItable():
|
|||
use = None # use all columns (and keep labels intact)
|
||||
labels_missing = []
|
||||
else:
|
||||
if isinstance(labels, str) or not isinstance(labels, Iterable): # check whether labels are a list or single item
|
||||
labels = [labels]
|
||||
indices = self.label_index(labels) # check requested labels ...
|
||||
dimensions = self.label_dimension(labels) # ... and remember their dimension
|
||||
present = np.where(indices >= 0)[0] # positions in request list of labels that are present ...
|
||||
|
|
Loading…
Reference in New Issue