【文件属性】:
文件名称:mathparse:用于评估自然语言数学方程的Python库
文件大小:285KB
文件格式:ZIP
更新时间:2021-05-07 16:19:59
python nlp mathematics Python
数学分析
mathparse库是一个Python模块,旨在评估字符串中包含的数学方程式。
这里有一些例子:
from mathparse import mathparse
mathparse . parse ( '50 * (85 / 100)' )
>> > 42.5
mathparse . parse ( 'one hundred times fifty four' , mathparse . codes . ENG )
>> > 5400
mathparse . parse ( '(seven * nine) + 8 - (45 plus two)' , language = 'ENG' )
>> > 24
安装
pip install mathparse
语言支持
必须设置language参数以便评估使用单词运算符的方程式。 语言代码应为有效的语言代码。
历史
有关更改,请参
【文件预览】:
mathparse-master
----setup.py(1KB)
----.gitignore(829B)
----.travis.yml(238B)
----LICENSE(1KB)
----.github()
--------workflows()
----mathparse()
--------mathwords.py(13KB)
--------mathparse.py(8KB)
--------__init__.py(223B)
----README.rst(1KB)
----tests()
--------__init__.py(0B)
--------test_replace_word_tokens.py(986B)
--------test_unary_operations.py(1006B)
--------test_utils.py(3KB)
--------test_binary_operations.py(3KB)
----.coveragerc(28B)
----dev-requirements.txt(66B)
----docs()
--------_templates()
--------index.rst(587B)
--------conf.py(5KB)
--------_static()