Skip to main content

Imports and command fxy with parameters to import libraries often used in research to emulate CAS software, or LAB software.

Introduction

  1. People coming from R, love that you can start quickly using it as a CALCulator,

  2. People coming from use of CAS tools like Maple, Mathematica have isympy, that is narrowly focused,

  3. People coming from computing LAB languages Matlab and R may find that Python requires quite a few imports just to do equivalent computing in Python.

This package fxy is a shorthand to do the imports packages to approximate these domains (CALC, CAS, and LAB) you’ve got a command fxy, that starts Python with needed packages pre-imported: so, you can start using Python like a calculator right away.

Installation

  • pip install fxy to get the import shortcuts.

Use as a calculator

$ fxy (pass, -i for IPython)

Usage as imports

  • from fxy.calc import * for quick CALC - basic mpmath calculator, and eday for time

  • from fxy.cas import * for basic CAS software (“Symbolic”) emulation

  • from fxy.lab import * for LAB software (“Numeric”) emulation

  • from fxy.plot import * for plotting imports.

Usage as command

The package defines the fxy command, if you just want Python with something, run:

  • $ fxy --calc starts Python with CALC imports (basic mpmath calculator)

  • $ fxy --cas (or -x) starts Python with CAS (Computer Algebra System) imports (to emulate Maple, Matematica,..)

  • $ fxy --lab (or -y) starts Python with LAB (Linear AlgeBra system) imports (to emulate MATLAB, R,…)

  • $ fxy --plot (or -p) for plotting imports

So, for example, if you want LAB imports with plotting and in IPython, then you’d:

  • $ fxy -ip --lab

You can also run the equivalent of –calc environment, that imports mpmath and eday, like this:

python -m fxy "pi**2"

The following are usage examples.

CALC

>>> from fxy.calc import *
>>> pi
<pi: 3.14159~>
>>> mp.dps = 250
>>> print(pi)

>>> 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 envy R users being able to start their ‘calculator’ with just one key, add something like the below to your ~/.zshrc:

# Basic Calculaor
function f() {
    . ~/.venv/bin/activate
    fxy "$@"
}

# Computer Algebra System
function F() {
    . ~/.venv/bin/activate
    fxy --qt --cas
}

Aliasing fxy as f command as simplest generic, and commonly used specific as F command makes it possible to:

  • Use f to start Python with just mpmath for fastest scientific calculations without IPython.

  • Use F to start Python with some specific other pre-configuration that you often use (e.g., f -ix emulates isympy).

Metadata

Release files for fxy 0.7.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for fxy 0.7.7
File Interpreter ABI Platform
fxy-0.7.7-py3-none-any.whl Python 3 none any Details

Release files / fxy-0.7.7-py3-none-any.whl

Download URL fxy-0.7.7-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be4d2d774890169cdf5e5808cfa9fa03fbfa8016386b2003a8040707331b05ee
BLAKE2b-256 checksum
How to use checksums
707bed208f63a6962596c968c23a89262bfcb1cbfb310f86e0dadecd741e3685
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.7.7 This release

1 release file

0.7.6

1 release file

0.7.4

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.9

1 release file

0.5.8

1 release file

0.5.7

1 release file

0.5.6

2 release files

0.5.5

2 release files

0.5.4

1 release file

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.9

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page