SignatureDataFrame.vig(odds_type='implied_probability')
Calculate the vigorish (juice) of each row of a DataFrame of odds.
Each row should hold one price for every outcome of a single market.
Parameters
odds_type:{'decimal', 'fractional', 'american', 'implied_probability'}, default 'implied_probability'- Format of the odds in the DataFrame.
Returns
- pandas.Series
- Vigorish values as decimals, with the same index as the input DataFrame.
See Series.vig for the formula.
Examples
#import pandas as pd
import stakepd as spd # importing stakepd adds these methods to pandas objects
Example:
implied_probs = pd.DataFrame({"A": [0.8, 0.5], "B": [0.3, 0.7]})
vig_values = implied_probs.vig()
print(vig_values)
Output:
0 0.090909
1 0.166667
dtype: float64
This method is also covered, alongside the rest of the module, in the overview guide.