A brief set of python functions for transforming en ef el data for optimization
When trying to run analysis for my fantasy team, I always ended up with a bunch of odd csv/excel sheets. This is an example of a series of functions I use to clean, transform, and combine data sources.
- Python 3.x
- petl
- numpy
- pandas
- Download salary csv from Draft Kings dot com.
- Download play by play data from nflsavant.com
- The files DKSalaries.csv and pbp-2018.csv should be in your working directory.
- Import ftbl_etl and call football_etl with a list of injured players.
- returns a Pandas dataframe that can be used for analysis
import ftbl_etl as fetl
injured_players = ['j.flacco', 'a.dalton']
fbl_df = fetl.football_etl(injured_players)
- Better handling for files (ie. names and location)
- Speed optimization
- clean up code
See license.