Premium problem29. Locations of the k Largest Values

Hard Locked

Build df = pd.DataFrame(np.random.RandomState(seed).randint(1, 101, size=(8, 8))). Return a list of the (column, row) index locations of the k largest values, ascending.

Input

seed = 30, k = 3

Output

[(5, 7), (6, 4), (2, 5)]

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)