Updating Old Julia Code - Cant get past ArgumentError: Invalid Index

The error you are showing in this picture is that in the original version, the variable player is a DataFrame created by the read_player_data function. In your version, player is a CSV.File. A CSV.File cannot be indexed like [1,:Batting_Order_Confirmed_]. You need to correct your version so that players is a DataFrame again. This will also fix the problem you had in yhe first picture.

Another good advice to update old julia code is to go version by version. By the date of the paper, it looks like it would be a good Idea to start running it with Julia v0.7. Julia v0.7 has especially crafted to make it easier to people to upgrade code from v0.6 to v1.0, where Julia became stable. Using v0.7 you will get useful messages about syntax and functions that were deprecated and it will suggest how to update them.

I saw that you were referred to the PSA, make it easier to help you. Please see number one: Don’t post your code as a screenshot; it is difficult to read and impossible to copy-paste.. Usually if you paste a complete code that we can copy and paste to get your error (instead of a picture), it will be more likely that you will receive a helpful answer.