X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=tableau.py;h=50c0291f03c93a11eec7b446370440cf8a40f1cd;hp=d2044d03fa337c09e5c357668276d8929db6f91f;hb=9ba3d2c5c6c49439c8b2ff4ae6bd7a632146850a;hpb=a38c33bb022324119c865d990e7ef1f087c24780 diff --git a/tableau.py b/tableau.py index d2044d0..50c0291 100644 --- a/tableau.py +++ b/tableau.py @@ -226,16 +226,17 @@ class Tableau() : def extractfrommod(self, col, val): return ([''] + self.colnames) + [line for line in self.csvtable[1:] if line[col + 1] == val] - def splitfromvar(self, col, var): + def splitfromvar(self, col): newtabs = {} for line in self.csvtable[1:] : - mod = line[col] + mod = line[col+1] if mod in newtabs : newtabs[mod].append(line) else : newtabs[mod] = [line] - return ([''] + self.colnames) + newtab - + for mod in newtabs : + newtabs[mod].insert(0, [''] + self.colnames) + return newtabs def check_rownames(self) : if len(self.rownames) == len(list(set(self.rownames))) :