Warzone Package: Part 2
Now that you have some data, let's analyze your performance.
To start, the package requires you to have a credentials.py file with the following:
user_inputs = {'repo': 'local data directory',
'gamertag': 'your gamertag',
'squad': ['friend gamertag1', 'friend gamertag2', '... etc'],
'file_name': 'Personal_Match_Data.csv'}You can adjust the name of your saved previous games to fit your preferred naming convention. At present, the package is not up on pypi so you will need to clone the repo from Github. Building the core class:
There is alot going on here.
CallofDuty(hacker_data=False, squad_data=True, streamer_mode=True)hacker_data should only be set to True if you have a dedicated hacker csv. This is a collection of matches where you have confirmed hackers are in the lobby. I did this by checking player stats after a match where I suspected there to be hackers and scraping their information/pass games. Rule of thumb, most people with a KD over 3 are hacking. You can check this in Codtracker after you have finished a match.
squad_data should be set to True by default. Assuming you have correctly added a credentials.py file with your usual squadmates (‘squad’: [‘friend gamertag1’, ‘friend gamertag2’, ‘… etc’],) this will build the Squad class and will return their stats for given modes.
streamer_mode should be set to False. I have it set to True because I am sharing my personal information here and would like to protect the privacy of my squadmates. If strreamer_mode is set to True, your personal Gamertag and your friend's Gamertags/uno identification numbers will be hidden.
After this has run you will have a CallofDuty class like the following:
gun_dictionary is a dict with all weapon names and their unique Activision names.
last_match_date_time is a Timestamp of your most recent game, this is helpful when scraping more matches. As it tells you how far back you need to load on CodTracker.
my_uno is a str of your unique Activision ID number. Here since streamer_mode is True that number is hidden.
name_uno_dict is a dict of Gamertags: Unos for all players you have played against/with.
Get Peter Rigali’s stories in your inbox
Join Medium for free to get updates from this writer.
other_df is a pd.DataFrame of all players who were not on your team/in your squad.
our_df is a pd.DataFrame of all players with who you have been in a squad with.
The idea here is that you want to do a comparative analysis between your squad and other squads in your lobby.
squad is a Squad class object.
squad_df will return all the stats in a pd.DataFrame format.
Above is the breakdown of the squad_dic. For Rebirth and Verdansk, each squadmate has stats for each mode. The stats are quite lengthy but here are a few screenshots of the stats returned.
whole is a pd.DataFrame of all the matches, consider this the data in its original state before being split into our_df and other_df.
user is a User class object that organizes the user inputs from the credentials.py file.
This post serves as an intro to understanding the basic CallofDuty object and how you can use it to see how you and your squadmates compare.
The package can be found here: https://github.com/pjrigali/Call-Of-Duty-Warzone-Analysis
Part 3: https://medium.com/@peterjrigali/warzone-package-part-3-c1cfa2be46bc
Part 1: https://medium.com/@peterjrigali/warzone-package-part-1-b64d753e949c










