Skip to content

Commit 90b8207

Browse files
committed
Merge pull request #13 from juanpabloaj/webstats_pep8
analyze_webstats with PEP8
2 parents 8386e85 + 6536b1b commit 90b8207

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ch01/analyze_webstats.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
x = x[~sp.isnan(y)]
2727
y = y[~sp.isnan(y)]
2828

29-
# plot input data
29+
3030
def plot_models(x, y, models, fname, mx=None, ymax=None, xmin=None):
31+
''' plot input data '''
3132

3233
plt.figure(num=None, figsize=(8, 6))
3334
plt.clf()
@@ -138,8 +139,8 @@ def error(f, x, y):
138139
train = sorted(shuffled[split_idx:])
139140
fbt1 = sp.poly1d(sp.polyfit(xb[train], yb[train], 1))
140141
fbt2 = sp.poly1d(sp.polyfit(xb[train], yb[train], 2))
141-
print("fbt2(x)= \n%s"%fbt2)
142-
print("fbt2(x)-100,000= \n%s"%(fbt2-100000))
142+
print("fbt2(x)= \n%s" % fbt2)
143+
print("fbt2(x)-100,000= \n%s" % (fbt2-100000))
143144
fbt3 = sp.poly1d(sp.polyfit(xb[train], yb[train], 3))
144145
fbt10 = sp.poly1d(sp.polyfit(xb[train], yb[train], 10))
145146
fbt100 = sp.poly1d(sp.polyfit(xb[train], yb[train], 100))

0 commit comments

Comments
 (0)