Skip to main content

Collection of utils for making your life easier when using the Python data science stack

Project description

python-ds-util

PyPI version

Installation

The library is available on pip:

pip install dsutil

Examples

For full usage examples see notebooks under the examples directory.

Plotting

Full examples for plotting here

  • add_grid(): reasonable default grid settings, with weak grey lines, light alpha, etc.

    import numpy as np
    import matplotlib.pyplot as plt
    from dsutil.plotting import add_grid
    
    x = np.linspace(0.0,100,10)
    y = np.random.uniform(low=0,high=10,size=10)
    
    plt.bar(x,y)
    
    add_grid()
    

  • add_value_labels() annotates barplots, line plots and scatter plots with values for the coordinates

    import numpy as np
    import matplotlib.pyplot as plt
    from dsutil.plotting import add_value_labels
    
    x = np.linspace(0.0,100,10)
    y = np.random.uniform(low=0,high=10,size=10)
    
    plt.bar(x,y)
    
    add_value_labels()
    

  • format_yaxis_percentage(): turns values between 0 and 1 in y-axis into percentages

    import numpy as np
    import matplotlib.pyplot as plt
    from dsutil.plotting import format_yaxis_percentage
    
    x = np.linspace(0.0,100,10)
    y = np.random.uniform(low=0,high=1,size=10)
    
    plt.bar(x,y)
    plt.yticks(np.arange(0,1.01,0.1))
    
    format_yaxis_percentage()
    

  • format_yaxis_thousands(): uses commas as thousands separator in the y-axis labels

    import numpy as np
    import matplotlib.pyplot as plt
    from dsutil.plotting import format_yaxis_thousands
    
    x = np.linspace(0.0,100,10)
    y = np.random.uniform(low=10000,high=100000,size=10)
    
    plt.bar(x,y)
    plt.yticks(np.arange(0,100001,10000))
    
    format_yaxis_thousands()
    

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

dsutil-0.2.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

dsutil-0.2.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file dsutil-0.2.1.tar.gz.

File metadata

  • Download URL: dsutil-0.2.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for dsutil-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0d9dd3fea263b39c3c7b8f2d9a315779e5982bd9399e1f33c4b3f2d0306dfa29
MD5 57dd01173b78eb436824e5470dc1cb5b
BLAKE2b-256 b50f9cbcb4473b5d1397ef784ced60754cf4a2419d53caca6ca425dd3b609afe

See more details on using hashes here.

File details

Details for the file dsutil-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dsutil-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for dsutil-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a13b6f4eea7c3646421d17e012b2f54c5bec9057724908fc0d802397aaabc27
MD5 6cb1c2307b1465f964fa5ab55a10f464
BLAKE2b-256 101a43a790b6317a0633a2128b4714bac05806dd5a4eef39e300694962b67481

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page