Name | fxy JSON |
Version |
0.5.9
JSON |
| download |
home_page | https://github.com/mindey/fxy |
Summary | Convenience imports and scientific functions. |
upload_time | 2024-03-05 14:40:21 |
maintainer | |
docs_url | None |
author | Mindey |
requires_python | |
license | UNLICENSE |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
fxy
===
.. |isympy| replace:: ``isympy``
Imports and command ``fx`` with parameters to import libraries often used in research to emulate CAS software, or LAB software.
Installation
------------
- ``pip install fxy`` to get the import shortcuts.
Introduction
------------
The people coming from use of CAS tools like ``Maple``, ``Mathematica`` or computing LAB languages ``Matlab`` and ``R`` may find that ``Python`` requires quite a few imports just to do equivalent computing.
This package ``fxy`` is a shorthand to do the imports packages to approximate these two domains (CAS, and LAB) you've got a command ``fx``, that starts Python with needed packages pre-imported: so, you can start using Python like a calculator right away.
Usage
-----
The package defines the `fx` command, if you just want Python with something, run:
- ``fx`` (e.g., ``fx -ip``) for quick CALC - Basic calculator
- ``fx -x`` (e.g., ``fx -ipx``) for basic CAS software ("Numeric") emulation
- ``fx -y`` (e.g., ``fx -ipy``) for LAB software ("Symbolic") emulation
In command line
---------------
- ``$ fx -i`` -- to use IPython + explicit imports.
- ``$ fx -p`` -- to import plotting.
CALC
----
::
>>> from fxy.calc import *
>>> pi
<pi: 3.14159~>
>>> from fxy.plot import *
>>> plt.plot([1, 2, 3, 4])
>>> plt.ylabel('some numbers')
>>> plt.show()
CAS
---
::
>>> from fxy.CAS import *
>>> f = x**4 - 4*x**3 + 4*x**2 - 2*x + 3
>>> f.subs([(x, 2), (y, 4), (z, 0)])
-1
>>> plot(f)
>>> plot3d(x**2-y**2)
LAB
---
::
>>> from fxy.LAB import *
>>> df = pandas.DataFrame({'x': numpy.arange(10), 'y': np.random.random(10)})
>>> df.sum()
x 45.000000
y 4.196558
dtype: float64
>>> X = [[0], [1], [2], [3]]
>>> y = [0, 0, 1, 1]
>>> neigh = sklearn.neighbors.KNeighborsClassifier(n_neighbors=3)
>>> neigh.fit(X, y)
>>> print(neigh.predict([[1.1]]))
[0]
>>> print(neigh.predict_proba([[0.9]]))
[[0.66666667 0.33333333]]
Suggestions
-----------
If you use some initialization commonly, we suggest adding ``~/.zshrc``, something like, for example:
::
alias f=". ~/.venv/bin/activate && fx -if"
Or, pass params, and alias:
::
function f() {
. ~/.venv/bin/activate
fx "$@"
}
alias fx="f -ipx" # for CAS with plotting
alias fy="f -ipy" # for LAB with plotting
This way, running something like ``f`` makes a project folder and starts Python environment with import sets often used.
.. _isympy:
https://linux.die.net/man/1/isympy
Raw data
{
"_id": null,
"home_page": "https://github.com/mindey/fxy",
"name": "fxy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Mindey",
"author_email": "mindey@mindey.com",
"download_url": "",
"platform": null,
"description": "fxy\n===\n.. |isympy| replace:: ``isympy``\n\nImports and command ``fx`` with parameters to import libraries often used in research to emulate CAS software, or LAB software.\n\nInstallation\n------------\n\n- ``pip install fxy`` to get the import shortcuts.\n\nIntroduction\n------------\n\nThe people coming from use of CAS tools like ``Maple``, ``Mathematica`` or computing LAB languages ``Matlab`` and ``R`` may find that ``Python`` requires quite a few imports just to do equivalent computing.\n\nThis package ``fxy`` is a shorthand to do the imports packages to approximate these two domains (CAS, and LAB) you've got a command ``fx``, that starts Python with needed packages pre-imported: so, you can start using Python like a calculator right away.\n\nUsage\n-----\nThe package defines the `fx` command, if you just want Python with something, run:\n\n\n- ``fx`` (e.g., ``fx -ip``) for quick CALC - Basic calculator\n- ``fx -x`` (e.g., ``fx -ipx``) for basic CAS software (\"Numeric\") emulation\n- ``fx -y`` (e.g., ``fx -ipy``) for LAB software (\"Symbolic\") emulation\n\nIn command line\n---------------\n\n- ``$ fx -i`` -- to use IPython + explicit imports.\n- ``$ fx -p`` -- to import plotting.\n\nCALC\n----\n\n::\n\n >>> from fxy.calc import *\n >>> pi\n <pi: 3.14159~>\n\n >>> from fxy.plot import *\n >>> plt.plot([1, 2, 3, 4])\n >>> plt.ylabel('some numbers')\n >>> plt.show()\n\nCAS\n---\n\n::\n\n >>> from fxy.CAS import *\n >>> f = x**4 - 4*x**3 + 4*x**2 - 2*x + 3\n >>> f.subs([(x, 2), (y, 4), (z, 0)])\n -1\n >>> plot(f)\n >>> plot3d(x**2-y**2)\n\nLAB\n---\n\n::\n\n >>> from fxy.LAB import *\n >>> df = pandas.DataFrame({'x': numpy.arange(10), 'y': np.random.random(10)})\n >>> df.sum()\n x 45.000000\n y 4.196558\n dtype: float64\n\n >>> X = [[0], [1], [2], [3]]\n >>> y = [0, 0, 1, 1]\n >>> neigh = sklearn.neighbors.KNeighborsClassifier(n_neighbors=3)\n >>> neigh.fit(X, y)\n >>> print(neigh.predict([[1.1]]))\n [0]\n >>> print(neigh.predict_proba([[0.9]]))\n [[0.66666667 0.33333333]]\n\n\nSuggestions\n-----------\n\nIf you use some initialization commonly, we suggest adding ``~/.zshrc``, something like, for example:\n\n::\n\n alias f=\". ~/.venv/bin/activate && fx -if\"\n\nOr, pass params, and alias:\n\n::\n\n function f() {\n . ~/.venv/bin/activate\n fx \"$@\"\n }\n\n alias fx=\"f -ipx\" # for CAS with plotting\n alias fy=\"f -ipy\" # for LAB with plotting\n\n\nThis way, running something like ``f`` makes a project folder and starts Python environment with import sets often used.\n\n\n.. _isympy:\n https://linux.die.net/man/1/isympy\n",
"bugtrack_url": null,
"license": "UNLICENSE",
"summary": "Convenience imports and scientific functions.",
"version": "0.5.9",
"project_urls": {
"Homepage": "https://github.com/mindey/fxy"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "925460bcfb5d386709aa0c2e890c20a2b589df44bf3d419b73685e7f2cb25564",
"md5": "ba56d5cca9a27f339b58dbd9d8373d22",
"sha256": "0ee7a3dea34199ae0255ecd42989da1dafceb0b9a41faa61ad71e7dcac684ee7"
},
"downloads": -1,
"filename": "fxy-0.5.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ba56d5cca9a27f339b58dbd9d8373d22",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10961,
"upload_time": "2024-03-05T14:40:21",
"upload_time_iso_8601": "2024-03-05T14:40:21.382576Z",
"url": "https://files.pythonhosted.org/packages/92/54/60bcfb5d386709aa0c2e890c20a2b589df44bf3d419b73685e7f2cb25564/fxy-0.5.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-05 14:40:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mindey",
"github_project": "fxy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "fxy"
}