pnxenopoulos / awpy

Python library to parse, analyze and visualize Counter-Strike 2 data
http://www.awpycs.com
MIT License
366 stars 56 forks source link

parser is adding an extra player #95

Closed ktian9 closed 2 years ago

ktian9 commented 2 years ago

Describe the bug Following the code from the example notebook for analyzing a csgo demo,

    demo_parser = DemoParser(demofile=demName,
    demo_id=demName.split(".")[0], parse_rate=128)

    data = demo_parser.parse()
    data_df = demo_parser.parse(return_type="df")
    print(csgo.analytics.stats.player_box_score(data_df["damages"], data_df["flashes"], data_df["grenades"], data_df["kills"], data_df["rounds"], data_df["weaponFires"]))

I supplied the demo located at here: https://demos-us-central1.faceit-cdn.net/csgo/1-8a57ec16-beb2-4ab5-bd2e-37419211b4d2-1-1.dem.gz

and I ran into a TypeError exception image

and when going to the kast function and inserting a print statement here:

image

I am able to see what seems like an extra player is being added somewhere "None", which should not be happening

image

pnxenopoulos commented 2 years ago

One thing we could do is to replace None with "None" or "World". Something to indicate that this has no attacker.

pnxenopoulos commented 2 years ago

Should be fixed in #102. Reopen if you come across more errors.