↓ Skip to main content
All methods

pandas.Series.odds

Series method → Series
Signature
Series.odds(odds_type='decimal')

Convert a Series of implied probabilities to the specified odds type.

Parameters

odds_type:{'decimal', 'fractional', 'american'}, default 'decimal'
Format of the odds to return.

Returns

pandas.Series
Odds as float values in odds_type format.

See also

pandas.Series.implied_probability
The reverse: odds to implied probabilities.
pandas.DataFrame.odds
Convert a DataFrame of implied probabilities to the specified odds type.
pandas.Series.as_fraction
Show fractional odds as strings like '2/1'.

Examples
#

import pandas as pd
import stakepd as spd   # importing stakepd adds these methods to pandas objects

Example:

prob = pd.Series([0.5, 0.4])
odds_vals = prob.odds(odds_type = 'decimal')
print(odds_vals)
Output:
0    2.000000
1    2.500000
dtype: float64

Kalshi prices as odds:

Kalshi contract prices are implied probabilities, so they can be turned into odds directly. See the Kalshi recipes.

from stakepd import kalshi_data as kd

m = kd.KalshiClient().get_markets(event_ticker="KXHIGHNY-26NOV27")
m = m[m.yes_ask > 0]
m["american"] = m.yes_ask.odds(odds_type="american")

This method is also covered, alongside the rest of the module, in the overview guide.