Skip to main content

Convenience imports and scientific functions.

Project description

Just a convenience imports for scientific functions and packages for calculation.

  • pip3 install fxy to get the import shortcuts.

  • pip3 install fxy[main] to install all libraries except xgboost,

  • pip3 install fxy[all] (slow) to install all libraries for which the shortcuts exist.

https://wiki.mindey.com/shared/screens/video-cover.png

Usage

If you are in command line, and just want Python with something, run:

  • $ fxy -[n|s|a|p|l] - to do with Python

  • $ fxy -i[n|s|a|p|l] - to do with IPython

  • $ fxy -b[n|s|a|p|l] - to do with BPython

If you are in existing environment of some kind, just do, to import:

  • from fxy.n import *, if you need mpmath and plotting.

  • from fxy.s import *, if you need isympy imports.

  • from fxy.a import *, if you need numpy, pandas, xarray, scipy, statsmodels and matplotlib, seaborn.

  • from fxy.p import *, if you need matplotlib and seaborn.

  • from fxy.l import *, if you need sklearn.* as sklearn and xgboost as xgb.

About

This package may be useful for computing basic things, doing things to emulate Python’s capabilities in computational and symbolic mathematics and statistics, so this package will introduce just convenient imports so that one doesn’t have to configure Jupyter notebook profile, to have those imports every time, and works well as an on-the-go calculator.

This package does not assume versions of the imported packages, it just performs the basic imports, assuming that those namespaces within those packages will exist for a long time to come, so it is dependencies-agnostic.

# Numeric (mpmath.*)
>>> from fxy.n import * (394 functions)
>>> pi
<pi: 3.14159~>

# Symbolic (sympy.*)
>>> from fxy.s import * (915 functions, and "isympy" imports)
>>> f = x**4 - 4*x**3 + 4*x**2 - 2*x + 3
>>> f.subs([(x, 2), (y, 4), (z, 0)])
-1
>>> plot(f)

# Actuarial (np: numpy, pd: pandas, sm: statsmodels.api, sp: scipy, st: scipy.stats, smf: statsmodels.formula.api, statsmodels)
>>> from fxy.a import *
>>> df = pandas.DataFrame({'x': numpy.arange(10), 'y': np.random.random(10)})
>>> df.sum()
x    45.000000
y     4.196558
dtype: float64

# Learning (sklearn.* as sklearn)
>>> from fxy.l import *
>>> X = [[0], [1], [2], [3]]
>>> y = [0, 0, 1, 1]
>>> neigh = skl.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]]

# Plotting (plt, matplotlib)
>>> from fxy.p import *
>>> plt.plot([1, 2, 3, 4])
>>> plt.ylabel('some numbers')
>>> plt.show()
<image>

I often collect convenient computations and functions in various fields, like what WolframAlpha does cataloguing implementations of advanced computations to be reused.

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

fxy-0.3.3.tar.gz (5.6 kB view details)

Uploaded Source

File details

Details for the file fxy-0.3.3.tar.gz.

File metadata

  • Download URL: fxy-0.3.3.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for fxy-0.3.3.tar.gz
Algorithm Hash digest
SHA256 cf8941d6ddd4c083fb6ce03171d1844625165d30e13edb4d08ae8cc43e5700ab
MD5 7c140c326c97d7c1c151f026c195a9d2
BLAKE2b-256 f79d50fcf535391a88c1f37c210903d637363693585178bb47c5c96ac0703d9d

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