Skip to content

data_frame

saltie edited this page Jun 18, 2020 · 5 revisions

This file is autogenerated do not edit

pandas.DataFrame

Summary

The DataFrame is an instance of two-dimensional, size-mutable, potentially heterogeneous tabular data. It comes as part of the pandas package (often imported as pd).

The index column (no header) represents each in-game frame from the replay (i.e. if the game runs in 60fps, there will be 60 rows in the DataFrame for every second passed in the game).

Each column is a tuple, and detailed information about all of them can be seen by using data_frame.info(verbose=True), and the example below perfectly illustrates this structure.

For extensive documentation, refer to the official pandas website.

Important Methods

To effectively use the DataFrame object, below are listed some of the more valuable methods. Please make sure that you search the pandas docs for clarifications, before asking questions.

data_frame.x.y

For example, data_frame.game.time.

This method simply narrows the scope to the selected column(s). The x variable refers to the first value of the tuple, and the y variable refers to the second value of the tuple (if only x is provided, all columns belonging to that tuple will be returned)

The first (left-most) column still refers to the consecutive in-game frames.

Notes:

  • To see all available columns, either refer to the given example, or do data_frame.info(verbose=True)

data_frame.loc()

For example, data_frame.loc[1, 'Player'] data_frame.loc[1, ('Player', 'ping')]

data_frame.loc[index, column_key] where index is the in-game frame number, and column_key is the column that you wish to access (to access a single, specific column, use the desired tuple in brackets).

Notes:

  • The index is an integer, not a string.
  • The column keys are always strings.

data_frame.at()

Exactly the same as .loc(), but should preferably be used to access single values, as opposed to many rows/columns.

Example (list of columns)

Each subheading is the primary column heading, and each row is the secondary column heading.The 'Player' subheading will be unique for each player in the replay (i.e. for a 3v3 game, there will be 6 distinct players)

Player

ping
pos_x
pos_y
pos_z
vel_x
vel_y
vel_z
ang_vel_x
ang_vel_y
ang_vel_z
throttle
steer
handbrake
rot_x
rot_y
rot_z
ball_cam
boost
boost_active
jump_active
dodge_active
double_jump_active

ball

pos_x
pos_y
pos_z
vel_x
vel_y
vel_z
ang_vel_x
ang_vel_y
ang_vel_z
hit_team_no
rot_x
rot_y
rot_z

game

time
delta
seconds_remaining
replicated_seconds_remaining
is_overtime
ball_has_been_hit
goal_number

Player

boost_collect