Skip to main content
100%

Gist b515456174db6bc9128368273472fee1

✓ Published0🌍 Public
CConorAspell
Last edited May 11, 2022
Created on May 11, 2022

This example shows a fantasy Premier League transfer suggestion tool that selects one player to swap out and one to bring in for a given team. It calculates a budget based on the current squad’s bank and the outgoing player’s cost, then filters potential replacements by position and team restrictions. The code uses the FPL API endpoints for bootstrap-static and entry event picks, with pandas for data manipulation and weighting logic. It randomly picks an outgoing player weighted by `out_weight` and an incoming player weighted by `in_weight`, then returns the transfer as a JSON response via a lambda function.

AI-generated description

Similar vizzes