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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file points_table_simulator-2.0.1.tar.gz.

File metadata

  • Download URL: points_table_simulator-2.0.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for points_table_simulator-2.0.1.tar.gz
Algorithm Hash digest
SHA256 3e7eb419bbe9b0e9dfa9e66b3e8af984de46934b03670e4431d7c965e151f120
MD5 c1a2b284073ead0c110b882939d2182f
BLAKE2b-256 4c9df6fb1c03170c8a8e68800a8dcfbbbaa05b18349f7f72c49ba190dcaee924

See more details on using hashes here.

File details

Details for the file points_table_simulator-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for points_table_simulator-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53ebb98978fe77fde47ebec80348e8cd17d1352faba6369f3d3f218216adb01f
MD5 a8da0700214191bbd14cb382b43a0b61
BLAKE2b-256 e246d6e2a59a85929f8671424c9388b11b9358fa77ed216e7a69be5fd95a4428

See more details on using hashes here.

Supported by

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