• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

josephcslater/array_to_latex

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

josephcslater/array_to_latex

开源软件地址(OpenSource Url):

https://github.com/josephcslater/array_to_latex

开源编程语言(OpenSource Language):

Python 51.6%

开源软件介绍(OpenSource Introduction):

Convert NumPy/SciPy arrays and Pandas Dataframes to formatted LaTeX arrays

https://badge.fury.io/py/array-to-latex.png/ PyPi Download stats

The module array_to_latex converts a NumPy/SciPy array or Pandas Numerical DataFrame to a LaTeX array or table using Python 3.x style formatting of the result.

Play with it on mybinder.org!

A NumPy-focused reenvisioned converter based, in part, on this is numpyarray_to_latex. Also also available pip install. It incorporate more sophisticated "sub" markup capabilities. Check it out!

Recent updates follow, with a more complete list towards the end of this document. If you don't see the current version in this list it's likely because I (again) forgot to update it when pushing out a new version. Please see the readme on GitHub.

0.80: Return to previous interface while still enabling returned
LaTeX string.
0.81: Bug fixes in requirements and to_clp
0.82: Raise ImportError exception when incorrect datatype used.

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]])
latex_code = a2l.to_ltx(A, frmt = '{:6.2f}', arraytype = 'array', print_out=False)

will put the LaTeX code into variable latex_code.

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.

If you will be using the same conversion over and over, you can define your own by using a lambda function:

to_tex = lambda A : a2l.to_ltx(A, frmt = '{:6.2f}', arraytype = 'array', mathform=True)
to_tex(A)

so you can now use your function to_tex repeatedly with your specified settings. More detailed information on usage is in the help.

import array_to_latex as a2l
help(a2l.to_ltx)

Interesting alternative approaches are np_array_to_latex and tab2latex (convert numpy array to longtable file).

Like this module, buy me a coffee!

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.
New in 0.43: Now handles 1-D Arrays. See new option row
New in 0.50: Now works with Pandas DataFrames
0.51: Bug fix- remove extra blank lines in DataFrame tabular output
0.52: A few documentation typos fixed. No code changed.
0.60: Now handles strings in Pandas Dataframes. Fixes bug in exponentials and handling of exponentials. Please report errors!
0.61: Minor documentation improvements. No code changed.
0.70: Added mathform. When set to True (default), returns 10 to superscript form.
0.71: Line breaks broke readme.rst on pypi. No code change.
0.72: Line breaks broke readme.rst on pypi. No code change.
0.73: pypi won't handle mathjax. It makes me sad. No code change.
0.74: Not released
0.75: output improvements (short-lived release)
0.76: Printing made better, allows outputs, added print_out
boolean to turn off printing
0.80: Return to previous interface while still enabling returned
LaTeX string.
0.81: Bug fixes in requirements and to_clp
0.82: Raise ImportError exception when incorrect datatype used.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap