Ecological electivity and forage indices
Project description
electivity
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
Using pip
pip install electivity
Using pipenv
pipenv install electivity
pipenv shell
Usage
Every electivity
function take two parameters—a list of available resources and a list of consumed resources—and return an equal-length list 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.
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) |
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
electivity-1.0.0.tar.gz
(6.5 kB
view hashes)
Built Distribution
electivity-1.0.0-py3-none-any.whl
(16.1 kB
view hashes)
Close
Hashes for electivity-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26d846ca31d48e511fca4ba8f5730f5efbdf0077e772af47db34c74475e65fa9 |
|
MD5 | f7570de1870f0f420564dfc955d13d66 |
|
BLAKE2b-256 | 5ad6654ffdaf80315a7921d2936039f5f9802145279facfa06398d742db31cea |