X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=tableau.py;fp=tableau.py;h=50c0291f03c93a11eec7b446370440cf8a40f1cd;hp=d2044d03fa337c09e5c357668276d8929db6f91f;hb=a6c0faa62f33e5e64ad7eab5b9d804be99c6759a;hpb=372c8e0f417eec05e526c019889ea11a4fabac49 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))) :