I have two dataframes. One is a dataframe containing the injury history of all players before 2013, the rows are the names of each player, and the columns in this dataframe are upper leg, lower leg, arm, hand, etc, different body parts whereas and the number of days each player was out with said injury(ies) on the particular body part. Ex: If I had a hand injury in 2010 for 20 days and I had another hand injury in 2012 for 15 days, the column under 'hand' under my name would have 35.

The second dataframe is a dataframe of all the injuries in this league post 2013. The relevant columns are 'injury part', 'injury duration', 'date', and 'player name'. I would like to perform an analysis the second dataframe while continuously changing the first dataframe. I would like to see if a player's injury history affects the likelihood of which body part gets injured. Plus, I would like to see if the player's injury history plays a length in how severe the injury is (will the duration be longer if the player has a history of injuring that particular body part?). However, while I'm performing this analysis, I would also like to continuously be changing the first dataframe by modifying each player's row if they were to incur a new injury post 2013 and using it.

Does anyone know if this is possible on python? And how it would be deployed/what is the name of the method? Any examples would be greatly appreciated!

Thank you!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.