↓ Skip to main content
All methods

API reference

Every stakepd method and function on its own page, with parameters, return values and examples.

Methods on pandas objects become available as soon as stakepd is imported:

import pandas as pd
import stakepd as spd

pd.Series([2.0, 3.5, 1.8]).implied_probability()

Looking for prediction-market data? See the kalshi_data reference.

Odds conversion

Move between decimal, fractional and American odds and implied probabilities. Available on every pandas.Series and pandas.DataFrame once stakepd is imported.

pandas.Series.implied_probabilityCalculate the implied probability from a Series of odds.
pandas.DataFrame.implied_probabilityCalculate the implied probability from a DataFrame of odds.
pandas.Series.oddsConvert a Series of implied probabilities to the specified odds type.
pandas.DataFrame.oddsConvert a DataFrame of implied probabilities to the specified odds type.
pandas.Series.convertConvert a Series between odds types, or between odds and implied probability.
pandas.DataFrame.convertConvert a DataFrame between odds types, or between odds and implied probability.
pandas.Series.as_fractionConvert fractional odds from floating point to fractions in string form.
pandas.Series.as_floatConvert fractional odds from fraction strings to floating point.

Bookmaker margin

Measure and remove the bookmaker’s margin from a market’s prices.

pandas.Series.overroundCalculate the overround of a Series of odds.
pandas.DataFrame.overroundCalculate the overround of each row of a DataFrame of odds.
pandas.Series.vigCalculate the vigorish (juice) of a Series of odds.
pandas.DataFrame.vigCalculate the vigorish (juice) of each row of a DataFrame of odds.
pandas.Series.devigRemove the vig from a Series of implied probabilities.
pandas.DataFrame.devigRemove the vig from each row of a DataFrame of implied probabilities.

Bet sizing and returns

Module-level functions, called as spd.<name>(...).

stakepd.payoutCalculate the payout of a bet, or of a Series of bets.
stakepd.profitCalculate the profit of a bet, or of a Series of bets.
stakepd.kelly_criterionCalculate how much to stake on a positive-EV bet using the Kelly criterion.