Skip to main content

Cornell Ecology Programs in Python

Project description

CornPy: Cornell Ecology Programs in Python

CornPy provides Python wrappers for two classic programs for ecological data analyses, DECORANA (DEtrended COrrespondence ANAlysis) and TWINSPAN (Two-Way SPecies INdicator ANalysis). Both programs were written by M. O. Hill in FORTRAN for mainframe computers, and modified for the IBM PC.

These modified versions use the "strict" convergence criteria of Oksanen & Minchin (1997) for eigenanalysis, with a tolerance of 0.000005 and a maximum iteration limit of 999. In DECORANA, the bug in non-linear scaling has been corrected.

Besides binary executables compiled with GNU gfortran to run under MS-Windows or GNU/Linux, FORTRAN source files, decorana.f and twinspan.f, are also provided for those who wish to change the maximum dimensions (by simply changing the numbers in the first PARAMETER statement in each program).

Both programs require an input data file in Cornell Condensed format, containing the community data to be analysed. The layout of this file should follow the same rules as for the original versions of DECORANA and TWINSPAN. The write_cep() function included in this package will automatically convert a pandas dataframe into a the required format for input to each program.

Install via 'pip install cornpy'


CornPy is distributed under the GNU General Public License




Detrended correspondence analysis:

import pandas as pd
import cornpy as cp
df = pd.read_csv("data.csv")
site_scores, species_scores = cp.decorana(df)

Two-way species indicator analysis:

import pandas as pd
import cornpy as cp
df = pd.read_csv("data.csv")
output = twinspan(df)

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

cornpy-0.1.0.tar.gz (5.1 kB view hashes)

Uploaded source

Built Distribution

cornpy-0.1.0-py3-none-any.whl (19.2 kB view hashes)

Uploaded py3

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