/reshape

The missing Numpy's reshape for Python

Primary LanguagePythonMIT LicenseMIT

reshape

Documentation Status Updates

The missing Numpy's reshape for Python.

Features

>>> import reshape
>>> for row in reshape.reshape(range(20), 3):
...     print(row)
...
(0, 7, 14)
(1, 8, 15)
(2, 9, 16)
(3, 10, 17)
(4, 11, 18)
(5, 12, 19)
(6, 13, None)
>>>
>>> for row in reshape.reshape("HVNfromPymiVN"):
...     print(row)
...
('H', 'o', 'i')
('V', 'm', 'V')
('N', 'P', 'N')
('f', 'y', None)
('r', 'm', None)

>>> reshape.print_cols(range(28), cols=4, format_each="{:>3}")
  0   7  14  21
  1   8  15  22
  2   9  16  23
  3  10  17  24
  4  11  18  25
  5  12  19  26
  6  13  20  27

TODO

  • Use mypy

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.