j
k
j a
j l
def transpose(p: P) -> P: return { **p, "x": p['y'], "y": p['x'], }
There's also the older way, which should work even on Python 2: def transpose(p: P) -> P: return dict(p, x=p['y'], y=p['x'])
Back to the thread
Back to the list