spd.payout(stakes, odds, odds_type)
Calculates the payout from a bet or a Series of bets.
Parameters:
stakes(float,int, orpandas.Series): Scalar or Series of stake/bet values.odds(float,int, orpandas.Series): Scalar or Series of odds inodds_typeformat. Must match the type ofstakes(scalar or Series of the same length).odds_type(str): Type of odds provided. Supported values are'decimal','fractional','american', and'implied_probability'.
Returns:
float: Payout of the bet, orpandas.Series: Series of payouts with the same length asstakesandodds.
Example (scalar):
import stakepd as spd
stakes = 100
odds = 2
payout = spd.payout(stakes, odds, 'decimal')
print(payout)
200
Example (Series):
import pandas as pd
import stakepd as spd
stakes = pd.Series([100, 50, 10])
odds = pd.Series([2.0, 3.0, 1.5])
payouts = spd.payout(stakes, odds, 'decimal')
print(payouts)
0 200.0
1 150.0
2 15.0
dtype: float64