Table Of Contents

Previous topic


Next topic

evaporation module

This Page

Standardized Precipitation Index (SPI)


The spi module defines a single function, spi to compute the standardized precipitation index.

spi(rainfall, span=3, freq='monthly', start_reference=None, end_reference=None, distribution='gamma')

Computes the standardized precipitation index for the precipitation series at the given span.


rainfall : time_series

Series of monthly cumulative precipitation.

span : {3, int} optional

Span, in months.

freq : {‘monthly’,’weekly’} optional


start_reference : {None, Date} optional

Starting date of the reference period. If None, use the first date of the series.

end_reference : {None, Date} optional

Ending date of the reference period. If None, use the last date of the series.

distribution : {‘gamma’,’normal’} optional

Type of distribution for the data of each period.