get labels without shape information

This commit is contained in:
Martin Diehl 2019-11-27 08:43:20 +01:00
parent 31d3958ca6
commit 882a11c5f8
1 changed files with 2 additions and 2 deletions

View File

@ -69,10 +69,11 @@ class Table():
return Table(np.loadtxt(f),headings,comments) return Table(np.loadtxt(f),headings,comments)
def get_array(self,label): def get_array(self,label):
return self.data[label].to_numpy().reshape((-1,)+self.headings[label]) return self.data[label].to_numpy().reshape((-1,)+self.headings[label])
def get_labels(self):
return [label for label in self.headings]
def add_array(self,label,array,info): def add_array(self,label,array,info):
if np.prod(array.shape[1:],dtype=int) == 1: if np.prod(array.shape[1:],dtype=int) == 1:
@ -86,7 +87,6 @@ class Table():
columns=[label for l in range(size)]) columns=[label for l in range(size)])
self.data = pd.concat([self.data,new_data],axis=1) self.data = pd.concat([self.data,new_data],axis=1)
def to_ASCII(self,fname): def to_ASCII(self,fname):
labels = [] labels = []
for l in self.headings: for l in self.headings: