Skip to main content

DOI

electivity

Ecological electivity and forage indices

Description

A compact scientific package for calculating electivity and forage preference indices including Ivlev E, Jacobs D, and Vanderploeg and Scavia E*.

Designed to work seamlessly with Pandas dataframes.

Installation

pip install electivity

Usage

Every electivity function takes two parameters—a list of available resources and a list of consumed resources—and returns an equal-length Pandas Series of electivity values calculated element-wise. The easiest way to work with electivity is using Pandas dataframes, but any list-like data input will work. If a list output is desired, the output can be cast using list( ... ).

Example

import pandas as pd
import electivity

# Build a dataframe of resource data
data = pd.DataFrame({"available": [10, 10, 10], "consumed": [10, 3, 0]})

# Calculate Ivlev electivity and assign it to a new column
data = data.assign(E=electivity.ivlev_electivity(data.available, data.consumed))

Functions and indices

Function Algorithm
ivlev_forage_ratio Ivlev Forage Ratio E' (Ivlev 1961)
ivlev_electivity Ivlev Electivity E (Ivlev 1961)
jacobs_electivity Jacobs' Electivity D (Jacobs 1974)
jacobs_forage_ratio Jacobs' Forage Ratio Q (Jacobs 1974)
strauss_linear Strauss' Linear Index L (Strauss 1979)
chessons_alpha Chesson's Alpha α (Chesson 1978)
relativized_electivity Relativized Electivity Index E* (Vanderploeg & Scavia, 1979)

Citation

Zuspan, A. 2021. electivity: Ecological electivity and forage indices, v1.0.0, Zenodo, doi:10.5281/zenodo.4567591

References

  • Chesson, J. 1978. Measuring preference in selective predation. Ecology 59:211-215.
  • Ivlev, V. S. 1961. Experimental ecology of the feeding of fishes. Yale Univ. Press, New Haven.
  • Jacobs, J. 1974. Quantitative measurement of food selection. Oecologia (Berl) 14:413-417.
  • Strauss, R. E. 1979. Reliability estimates for Ivlev's electivity index, the forage ratio, and a proposed linear index of food selection. Trans Am Fish Soc 108: 344-352.
  • Vanderploeg H. A. and Scavia D. 1979. Calculation and use of selectivity coefficients of feeding: zooplankton grazing. Ecol Modelling 7:135-149.

Release files for electivity 2.0.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 electivity 2.0.0
File Size Uploaded
electivity-2.0.0.tar.gz 6.6 kB Details

Built distribution (wheel)

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

Total release size: 22.8 kB

Release files / electivity-2.0.0.tar.gz

Download URL electivity-2.0.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d6ae345d1ed7ed12da591121a59638a19a4e97ae7cee525d83373a6722c845ce
BLAKE2b-256 checksum
How to use checksums
9e0e14a4661053991a562a5eea5587b43dd25b86ca88003bab94d76478dd1fc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5

Release files / electivity-2.0.0-py3-none-any.whl

Download URL electivity-2.0.0-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3af15b052e99efbae7a67012c849cdeb993883696976a955ef0dd0cd70ea8f8c
BLAKE2b-256 checksum
How to use checksums
e851dfb2ec2caefe419cbf88db201343543d4df3fe3894baf4b016669fc5898f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.0

2 release files

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