Skip to main content

Return Numpy arrays as formatted LaTeX arrays.

Project description

https://badge.fury.io/py/array_to_latex.png/

The package array_to_latex converts a NumPy/SciPy array to a LaTeX array including Python 3.x style (or alternatively) formatting of the result.

New in 0.37: Now handles complex arrays.
New in 0.38: Aligns columns neatly.
0.40: Critical upgrade- 0.37-0.38 formatted incorrectly.
0.41: Critical upgrade- 0.37-0.40 formatted incorrectly.

Install using pip install --user array_to_latex

Please read the help which explains usage.

import numpy as np
import array_to_latex as ar
A = np.array([[1.23456, 23.45678],[456.23, 8.239521]])
ar.to_ltx(A, frmt = '{:6.2f}', arraytype = 'array')

will print the LaTeX code to your ouput.

import numpy as np
import array_to_latex as ar
A = np.array([[1.23456, 23.45678],[456.23, 8.239521]])
ar.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 ar
help(ar.to_ltx)

An interesting alternative approach is np array to latex.

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

array_to_latex-0.41.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file array_to_latex-0.41.tar.gz.

File metadata

  • Download URL: array_to_latex-0.41.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for array_to_latex-0.41.tar.gz
Algorithm Hash digest
SHA256 c31b912b288cf8822a8e975f74bab5aa3520d080464b58ada7b9093a1b90a89c
MD5 43caefab65723f4a0b34cab0006b1008
BLAKE2b-256 365d4365c9e00326d1730715f5b004cb88cdd16a34983d24b8aefb29f3aa1b53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page