Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jan 11, 2019
1 parent 230b066 commit bcd6ceb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 0 additions & 4 deletions _unittests/ut_homeblog/test_tableformula3.py
Expand Up @@ -5,10 +5,7 @@
import sys
import os
import unittest
import random
import numpy
import pandas
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase


Expand Down Expand Up @@ -47,7 +44,6 @@ def test_TableFormula_init(self):
vals = [0., 1.]
vals = [vals, vals]
tbl = TableFormula(vals)
z = tbl
tbl.header = ["x", "y"]
np = numpy.array(vals)
tbl2 = TableFormula(np)
Expand Down
12 changes: 6 additions & 6 deletions src/ensae_teaching_cs/homeblog/table_formula.py
Expand Up @@ -838,8 +838,8 @@ def __html__(self, class_table=None, class_td=None, class_tr=None, class_th=None
clth = ' class="%s"' % class_th if class_th is not None else ""

rows = ["<table%s>" % clta]
rows.append(("<tr%s><th%s>" % (cltr, clth))
+ ("</th><th%s>" % clth).join(self.header) + "</th></tr>")
rows.append("{0}{1}{2}".format(("<tr%s><th%s>" % (cltr, clth)),
("</th><th%s>" % clth).join(self.header), "</th></tr>"))
septd = "</td><td%s>" % cltd
strtd = "<tr%s><td%s>" % (cltr, cltd)
for row in self.values:
Expand Down Expand Up @@ -1367,8 +1367,8 @@ def avg(vec):
elif logging is not None:
end = min(len(keep), 10)
mes = ",".join([str(_) for _ in keep[:end]])
logging("removing column " + col
+ " no unique value: " + str(len(dd)) + ": " + mes)
logging("removing column '{0}' no unique value: {1}: {2}".format(
col, len(dd), mes))
elif col.startswith("sum"):
functions.append(lambda v, col=col: identical(col, v))
labels.append(col)
Expand Down Expand Up @@ -1792,7 +1792,7 @@ def filter_quantile(self, function, alpha_min=0.025, alpha_max=0.025):
i2 = min(i2, lv)
if i2 == i1:
raise RuntimeError("unable to extract quantile, the table is either "
+ "empty or chosen quantile are not correct")
"empty or chosen quantile are not correct")
values = [_[1] for _ in values[i1:i2]]
return self._private_getclass()(self.header, values)

Expand Down Expand Up @@ -1851,7 +1851,7 @@ def random(self, n, unique=False):
if unique:
if n > len(self):
raise ValueError("number of desired random rows is higher "
+ "than the number of rows in the table")
"than the number of rows in the table")
index = {}
while len(index) < n:
h = random.randint(0, len(self) - 1)
Expand Down

0 comments on commit bcd6ceb

Please sign in to comment.