diff --git a/README.md b/README.md index 25c663b..b1d96e6 100644 --- a/README.md +++ b/README.md @@ -635,6 +635,20 @@ class Employee(Person): self.staff_num = staff_num ``` +### Sequence +```python +class : + def __init__(self, seq): + self.seq = seq + def __len__(self): + return len(self.seq) + def __getitem__(self, i): + return self.seq[i] + def __iter__(self): + for el in self.seq: + yield el +``` + ### Copy ```python from copy import copy, deepcopy @@ -1321,7 +1335,7 @@ Table # $ pip3 install tabulate from csv import reader from tabulate import tabulate -with open(, newline='') as csv_file: +with open(, encoding='utf-8', newline='') as csv_file: reader = reader(csv_file, delimiter=';') headers = [a.title() for a in next(reader)] print(tabulate(reader, headers)) @@ -1544,14 +1558,16 @@ import numpy as np ``` ```python -value = .min([axis]) -index = .argmin([axis]) +first_column = [:, 0] # Or: [..., 0] +value = .min([axis]) +index = .argmin([axis]) ``` ```python - = .reshape() - = np.broadcast_to(, ) - = [filter_expression] +.shape = + = .reshape() + = np.broadcast_to(, ) + = [filter_expression] ``` ### Broadcasting