↓ Skip to main content
All methods

pandas.DataFrame.implied_probability

DataFrame method → DataFrame
Signature
DataFrame.implied_probability(odds_type='decimal')

Calculate the implied probability from a DataFrame of odds.

Each column is converted separately, and the output columns are named <column>_implied_probability.

Parameters

odds_type:{'decimal', 'fractional', 'american'}, default 'decimal'
Format of the odds in the DataFrame.

Returns

pandas.DataFrame
Implied probabilities as decimals (float), with the same index as the input.

See also

pandas.Series.implied_probability
Calculate the implied probability from a Series of odds.
pandas.DataFrame.odds
The reverse: implied probabilities to odds.
pandas.DataFrame.convert
Convert a DataFrame between odds types, or between odds and implied probability.

See Series.implied_probability for the formula used for each odds format.

Examples
#

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

Decimal odds (default):

odds = pd.DataFrame({"A": [2.0, 1.5, 5.0], "B": [50, 8.0, 25.0]})
implied_probabilities = odds.implied_probability()
print(implied_probabilities)
Output:
   A_implied_probability  B_implied_probability
0               0.500000                  0.020
1               0.666667                  0.125
2               0.200000                  0.040

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