Skip to main content

julialg

Julia-style arrays in Python

Python library for mimicking Julia LinearAlgebra array indexing style and display formatting.

Test Result: CircleCI

Motivation and Summary

Julia's LinearAlgebra package has some nice features, some of which are easier to emulate in Python than others. When comparing the results of Python code vs Julia code, it is annoying to have to mentally switch between the 0-indexed nature of Python and the 1-indexed nature of Julia. Also, the Julia arrays have a prettier array.

This package wraps numpy n-dimensional arrays in a new class, JulArray, and allows for 1-indexed slicing (more mathematically intuitive) instead of 0-indexed slicing (computer science convention). Also improves the prettiness of the representation of the array in a manner similar to Julia's LinearAlgebra package. To be clear, this is a Python package, meant to bring some of the elegance of Julia's interface for tensors to the Python setting

Indexing

The JulArray class wraps a numpy.ndarray but overrides the getitem syntax to allow for 1-indexed style instead of the default 0-indexed style. For example:

>>> import numpy, julialg

# Create a numpy array
>>> a = numpy.arange(1, 11).reshape((2, 5))

# Create a JulArray from the numpy array
>>> j = julialg.JulArray(a)

# Index the numpy array using 0-indexed syntax
>>> a[0, 0:2]
array([1, 2])

# Index the JulArray using 1-indexed syntax
>>> j[1, 1:3].array
array([1, 2])

Notice in the above sample that the JulArray is able to convert both ints and slices from 1-indexed notation to 0-indexed notation to produce the same underlying numpy array.

Display

The JulArray overrides the default representation of the numpy array to be more cleanly formatted (like Julia arrays).

>>> julialg.JulArray(numpy.arange(1.0, 11.0).reshape((2, 5)))
2x5 Array{float64,2}
  1.0000     6.0000
  2.0000     7.0000
  3.0000     8.0000
  4.0000     9.0000
  5.0000    10.0000

Metadata

Release files for julialg 0.1.0

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

Source distribution (sdist)

Source distribution for julialg 0.1.0
File Size Uploaded Provenance Actions
julialg-0.1.0.tar.gz 3.8 kB Without provenance Details for julialg-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 8.4 kB

Release files / julialg-0.1.0.tar.gz

Download URL julialg-0.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
75ff8104b307d5702000344175263e347606c396fbc7cf507c03dd6472bda6d1
BLAKE2b-256 checksum
How to use checksums
19b3a22b77de91be767f7b28b5e1ad1b3d2a3f1c981eefc1d77399110cd92aa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / julialg-0.1.0-py3-none-any.whl

Download URL julialg-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72a8733d95b4facb652fd5fe0cce47d40952671b3cc7bc067ec4404ed6738efb
BLAKE2b-256 checksum
How to use checksums
aec186f0a2f94e94e9977ec28803e5c5e4457f8f8adb3e7809796cb2a304dd24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Security for julialg 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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