Skip to main content

Float and custom indexes in Python

Project description

fidx

A module for float and custom indexes in Python

Allows to use float indexes to access lists, tuples, … in percentage (e.g. 0.5 is the middle item).
Allows also to add custom index types to existing types or to custom ones.

Installation

pip install fidx

Usage example

>>> import fidx

>>> fidx([1,2,3])[.5]
2

>>> l = fidx([1,2,3,4])
>>> l[:.5], l[.5:]
([1, 2], [3, 4])

>>> t = fidx.tuple(i//2 for i in range(0,10))
>>> t[.2:-.2:.2]
(1, 2, 3)

For more examples and usage, please refer to the Wiki.

About

Davide Peressoni – dpdmancul+fidx@gmail.com

Distributed under the MIT license. See LICENSE for more information.

https://gitlab.com/DPDmancul/

Changelog

  • version 1.1.0
    • Fix of #1
    • Added float_id method to extended classes.
    • Added fidx.float_idx_of function.

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

fidx-1.1.0.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file fidx-1.1.0.tar.gz.

File metadata

  • Download URL: fidx-1.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for fidx-1.1.0.tar.gz
Algorithm Hash digest
SHA256 101db3d28a1fe78746d0dc5c0d3ef48cec2fbd8ddc96a9f88559cbf4a7edc29a
MD5 a3d492c5b545c894d13f779977d5340f
BLAKE2b-256 3dc2680c3a3a8daa3c8322ada649e662479e71b1845533dd248b1a7a833cc0c4

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