Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import gzip
import json
def get_relative_frame(frame, position, new_position=(0,0)):
""" Rolls a frame such that position is moved to new_position
Input:
frame: 2-dimensional array
position: tuple (row, col)