Return Numpy arrays as formatted LaTeX arrays.
Project description
The package array_to_latex converts a NumPy/SciPy array or Pandas Numerical DataFrame to a LaTeX array or table using Python 3.x style (or alternatively) formatting of the result.
Play with it on mybinder.org!
Install using pip install --user array_to_latex from your command prompt, not the Python prompt.
Please read the help. It explains all options. To try it, see the online mybinder.org demo. It documents illustrates application to numerical Pandas DataFrames.
import numpy as np
import array_to_latex as a2l
A = np.array([[1.23456, 23.45678],[456.23, 8.239521]])
a2l.to_ltx(A, frmt = '{:6.2f}', arraytype = 'array')
will print the LaTeX code to your output.
import numpy as np
import array_to_latex as a2l
A = np.array([[1.23456, 23.45678],[456.23, 8.239521]])
a2l.to_clp(A, frmt = '{:6.2f}', arraytype = 'array')
will put the array onto your clipboard.
More detailed information on usage is in the help.
import array_to_latex as a2l
help(a2l.to_ltx)
An interesting alternative approach is np array to latex.
Like this module, buy me a coffee!
Project details
Release history Release notifications | RSS feed
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
Hashes for array_to_latex-0.52-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c00373f995a55553c56d0605e07e914cfded4ee92182214f880005fbb84ad17c |
|
MD5 | 558410ad73ff9f3b936c3790eb78e15d |
|
BLAKE2b-256 | fe4f5eb832fd44e91ba4de2d53fe2b024c30f00fae17c130cadb899d2bcbc83e |