Skip to main content

This package will simulate the points table based on different possible results in a sports tournament

Project description

points-table-simulator🔢

During the later part of the league stages in many multi-team tournaments 🏆 such as 🏏 Indian Premier League(IPL), Australian Big Bash League (BBL), ets., the fans will look for possible match outcomes for the remaining league matches, which could lead their favourite team to get qualified for further stage in the tournament (Playoffs). Here, the fans calculate their points table📊 to see their favourite team being placed in the position needed to qualify for Playoffs🏃🏻.

This tool🛠️ come as handy for those Sports enthusiasts which would help them to forsee the necessary remaining match outcomes to see their favourite team qualifying for playoffs✅ with the necessary match outcomes along with the respective points table📊.


This python package📦 will simulate the points table📊 based on different possible results in a sports tournament.

The PointsTableSimulator package provides a powerful tool for simulating and analyzing points tables for sports tournaments. Whether you're organizing or following a tournament, this package offers the flexibility to input tournament schedules, define points systems, and explore various match outcome scenarios to understand team standings and qualification possibilities.

Installation

Install this package with pip

pip install points-table-simulator

Usage/Examples

Please find the example usage from the below python code

from points_table_simulator import PointsTableSimulator
import pandas as pd

# Load the tournament schedule DataFrame
tournament_schedule = pd.read_csv("tournament_schedule.csv")

# Note: 
# The tournament schedule DataFrame should have the following columns:
#   - "match_number" column containing the match number
#   - "home" column containing the home team names
#   - "away" column containing the away team names
#   - "winner" column containing the match result (winning_team_name, draw, or no result)

# If the tournament schedule DataFrame contains different names than this, you can use arguments in PointsTableSimulator class to
# specify the column names. 

# Instantiate the PointsTableSimulator object
simulator = PointsTableSimulator(
    tournament_schedule=tournament_schedule,
    points_for_a_win=3,
    points_for_a_no_result=1,
    points_for_a_draw=1
)

# Get the current points table
current_table = simulator.current_points_table      # current_points_table is an attribute of PointsTableSimulator class

# Simulate qualification scenarios for a specific team
points_tables, qualification_match_results = simulator.simulate_the_qualification_scenarios(
    team_name="Team A",
    top_x_position_in_the_table=4,
    desired_number_of_scenarios=5
)

# points_tables - will return the list of points_tables (pd.Dataframe) for different qualification scenarios
# qualification_match_results - will return the list of table containing remaining match outcomes which could favour their team to get qualified for the given position

This package can also be used in Football tournaments such as English Premier League (EPL), Laliga, etc., when you want to generate the scenarios in which your favourite team can be placed in your expected position in the pointstable.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

points_table_simulator-2.0.1.tar.gz (14.7 kB view hashes)

Uploaded Source

Built Distribution

points_table_simulator-2.0.1-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page