Skip to main content
https://readthedocs.org/projects/fntools/badge/?version=master
target:

https://readthedocs.org/projects/fntools/?badge=master

alt:

Documentation Status

fntools provides functional programming tools for data processing. This module is a set of functions that I needed in my work and found useful.

Installation

pip install fntools

Examples

  • Split a list of elements with factors with split:

    songs = ('Black', 'Even Flow', 'Amongst the waves', 'Sirens')
    albums = ('Ten', 'Ten', 'Backspacer', 'Lightning Bolt')
    print split(songs, albums)
    {'Lightning Bolt': ['Sirens'], 'Ten': ['Black', 'Even Flow'], 'Backspacer': ['Amongst the waves']}
  • Determine whether any element of a list is included in another list with any_in:

    print any_in(['Oceans', 'Big Wave'], ['Once', 'Alive', 'Oceans', 'Release'])
    True
    
    print any_in(['Better Man'], ['Man of the Hour', 'Thumbing my way'])
    False
  • Apply many functions on the data with dispatch:

    # Suppose we want to know the mean, the standard deviation and the median of
    # a distribution (here we use the standard normal distribution)
    
    import numpy as np
    np.random.seed(10)
    x = np.random.randn(10000)
    
    print dispatch(x, (np.mean, np.std, np.median))
    [0.0051020560019149385, 0.98966401277169491, 0.013111308495186252]

Many more useful functions are available. For more details, go to the documentation.

Inspirations

Release files for fntools 1.1.1

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

Source distribution (sdist)

Source distribution for fntools 1.1.1
File Size Uploaded
fntools-1.1.1.tar.gz 7.2 kB Details

Release files / fntools-1.1.1.tar.gz

Download URL fntools-1.1.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1742f7545b9764b013cf9e7b05a0539ec6dc66f7832e9e919f63e4896b430686
BLAKE2b-256 checksum
How to use checksums
6578422308ab82055fabd9b7cb5da6c6e7926416fceb69588fda58cf7aa5f428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.1.2

2 release files

This release

1.1.1 This release

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

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