Display numpy ndarrays in a pretty table in Jupyter notebooks
Project description
ndpretty
Your little helper to display numpy ndarrays in a pretty table in Jupyter notebooks.
Jupyter notebooks are a great way to develop. ndpretty makes it even better for people who use numpy by providing nice formatting of ndarrays.
Install
pip install ndpretty
How to use
import ndpretty
import numpy as np
Display an ndarray using ndarray_html():
ndpretty.ndarray_html(np.random.rand(3, 4))
If you want all np.ndarrays and torch.Tensors to be automatically formatted like this, load the default configuration:
ndpretty.default()
After this line has been exectued, all cell outputs that are np.ndarray or torch.Tensor are automatically formatted by ndpretty.
a = np.random.rand(10, 5)
a
10×5 float64 ndarray
It works with all numpy dtypes, multi-dimensional arrays and PyTorch tensors.
Find more usage examples here.
Why?
Look at the alternatives.
Author
Patrick Deutschmann (patrick@deutschmann.xyz)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ndpretty-0.0.7.tar.gz.
File metadata
- Download URL: ndpretty-0.0.7.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fba5a77ff3c6d2ac7fb95ce4fde77a6e57614b8fb3b340f884f866327f0c1a85
|
|
| MD5 |
650ff24ae740968f5c22a893dc85a02e
|
|
| BLAKE2b-256 |
ae17428f1bd6bd8fbdf479f480a79eccd6556649e9201ea9a5dcbe7b6c24a7fe
|
File details
Details for the file ndpretty-0.0.7-py3-none-any.whl.
File metadata
- Download URL: ndpretty-0.0.7-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
620c924c7490888865d3bc0a09c357d63c6f755f2469c19f8b5063cbaef85313
|
|
| MD5 |
4700b642d4d6bdda703f32a292a273f8
|
|
| BLAKE2b-256 |
eccd9f3948cb2b0842498b766c0edb49364a7c8bd48490992ac448963d526fe7
|