Getting index counter on a data frame
I have the following data frame: import pandas as pd data = { "id_1": [1, 1, 1, 2, 2, 2], "id_2": [1, 1, 1, 2, 2, 2], "foo": [0.1, 0.1, 0.1, 0.2, 0.2, 0.2], } df = pd.DataFrame(data) df = df.set_index(["id_1", "id_2"]) which looks like this: foo id_1 id_2 1 1 0.1 1 0.1 1… Read More Getting index counter on a data frame