This project consists of three main Python functions designed to simulate fight data for a number of fighters, visualize the distribution of win percentages, and display the distribution of wins and losses. Here's a brief summary of each function:
-
generate_fighter_data(number_of_fighters): This function simulates fight data for a given number of fighters, each fighter having a varying number of fights and outcomes. It returns a pandas DataFrame with each row representing a fighter, and columns representing the number of wins and losses.
-
plot_fighter_data(number_of_fighters): This function first generates fighter data using the generate_fighter_data function. It then calculates the win percentage for each fighter and plots a histogram of these win percentages. The color coding of the histogram bars is done by height.
-
plot_win_loss_distribution(number_of_fighters): Similar to plot_fighter_data, this function first generates fighter data. It then calculates the counts of wins and losses, sorts these counts, and displays them in a bar plot.
Here is how you can use these functions:
plot_fighter_data(number_of_fighters=1000)
plot_win_loss_distribution(number_of_fighters=1000)
This project requires Python 3.6+ and the following Python libraries installed:
- numpy
- pandas
- matplotlib
This project is licensed under the MIT License - see the LICENSE.md file for details.