From 138ef28bced7a44e3553e56e1fb58e16c8dce2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 30 Jul 2019 05:13:41 +0200 Subject: [PATCH] Small fixes --- README.md | 12 ++++++------ index.html | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 71d5d3d..8a86c75 100644 --- a/README.md +++ b/README.md @@ -2210,7 +2210,7 @@ Plot ```python # $ pip3 install matplotlib from matplotlib import pyplot -pyplot.plot( [, , ...]) # Or: hist(). +pyplot.plot( [, , ...]) # Or: pyplot.hist() pyplot.savefig() pyplot.show() pyplot.clf() # Clears figure. @@ -2225,9 +2225,9 @@ Table from tabulate import tabulate import csv with open(, encoding='utf-8', newline='') as file: - lines = csv.reader(file) - headers = [header.title() for header in next(lines)] - table = tabulate(lines, headers) + rows = csv.reader(file) + header = [a.title() for a in next(rows)] + table = tabulate(rows, header) print(table) ``` @@ -2272,7 +2272,7 @@ logger.('A logging message.') * **Levels: `'debug'`, `'info'`, `'success'`, `'warning'`, `'error'`, `'critical'`.** ### Exceptions -**Error description, stack trace and values of variables are appended automatically.** +**Exception description, stack trace and values of variables are appended automatically.** ```python try: @@ -2379,7 +2379,7 @@ Profile ### Basic ```python from time import time -start_time = time() # Seconds since Epoch. +start_time = time() # Seconds since the Epoch. ... duration = time() - start_time ``` diff --git a/index.html b/index.html index aee7b51..d17268d 100644 --- a/index.html +++ b/index.html @@ -1913,7 +1913,7 @@ reader(adder(printer())) # 100, 101, ..., 109

#Plot

# $ pip3 install matplotlib
 from matplotlib import pyplot
-pyplot.plot(<data_1> [, <data_2>, ...])  # Or: hist(<data>).
+pyplot.plot(<data_1> [, <data_2>, ...])  # Or: pyplot.hist(<data>)
 pyplot.savefig(<filename>)
 pyplot.show()
 pyplot.clf()                             # Clears figure.
@@ -1923,9 +1923,9 @@ pyplot.clf()                             # Clears fig
 from tabulate import tabulate
 import csv
 with open(<filename>, encoding='utf-8', newline='') as file:
-    lines   = csv.reader(file)
-    headers = [header.title() for header in next(lines)]
-    table   = tabulate(lines, headers)
+    rows   = csv.reader(file)
+    header = [a.title() for a in next(rows)]
+    table  = tabulate(rows, header)
     print(table)
 
@@ -1962,7 +1962,7 @@ logger.<level>('A logging message.')
  • Levels: 'debug', 'info', 'success', 'warning', 'error', 'critical'.
-

Exceptions

Error description, stack trace and values of variables are appended automatically.

try:
+

Exceptions

Exception description, stack trace and values of variables are appended automatically.

try:
     ...
 except <exception>:
     logger.exception('An error happened.')
@@ -2044,7 +2044,7 @@ run(host='0.0.0.0', port=#Profile

Basic

from time import time
-start_time = time()                  # Seconds since Epoch.
+start_time = time()                  # Seconds since the Epoch.
 ...
 duration = time() - start_time