import pandas as pd import numpy as np df = pd.DataFrame({ "drop_id": [101, 102, 103, 104], "point": ["north", "south", "north", "south"], "material": ["leaves", "food", "food", "leaves"], "kg": [12., 8., 6., 10.], "bags": pd.array([3, 2, 1, 2], dtype="Int64"), "day": ["2026-10-01", "2026-10-01", "2026-10-02", "2026-10-02"], }) minimum = 10. selected = df.query("kg >= @minimum", engine="python") print(selected["drop_id"].tolist()) print(float(selected["kg"].sum()))