Mercurial Hosting > traffic-intelligence
changeset 675:ab3fdff42624
corrected old format for Point.__str__
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 26 May 2015 23:55:22 +0200 |
parents | 01b89182891a |
children | 58b9ac2f262f |
files | python/moving.py python/utils.py |
diffstat | 2 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/python/moving.py Tue May 26 18:16:51 2015 +0200 +++ b/python/moving.py Tue May 26 23:55:22 2015 +0200 @@ -168,7 +168,7 @@ self.y = y def __str__(self): - return '(%f,%f)'%(self.x,self.y) + return '({:f},{:f})'.format(self.x,self.y) def __repr__(self): return self.__str__()
--- a/python/utils.py Tue May 26 18:16:51 2015 +0200 +++ b/python/utils.py Tue May 26 23:55:22 2015 +0200 @@ -321,7 +321,7 @@ def frenchify(s, displayNames): return s -def kruskalWallis(data, dependentVariable, independentVariable, plotFigure = False, filenamePrefix = None, figureFileType = 'pdf', saveLatex = False): +def kruskalWallis(data, dependentVariable, independentVariable, plotFigure = False, filenamePrefix = None, figureFileType = 'pdf', saveLatex = False, displayNames = {}): '''Studies the influence of (nominal) independent variable over the dependent variable Makes tests if the conditional distributions are normal @@ -348,9 +348,10 @@ plt.savefig(filenamePrefix+'-{}-{}.{}'.format(dependentVariable, independentVariable, figureFileType)) table = tmp.groupby([independentVariable])[dependentVariable].describe().unstack().sort(['50%'], ascending = False) if saveLatex: - out.write('\begin{table}[htp!]') + out.write('\\begin{table}[htp!]\n') out.write(frenchify(table.to_latex(), displayNames)) - out.write('\end{table}[htp!]') + out.write('\caption{Test}\n' + +'\end{table}[htp!]') else: print table return kruskal(*[tmp.loc[tmp[independentVariable] == x, dependentVariable] for x in independentVariableValues])