Detect parent rows of each row and add their values to a new column
Detect immediate parent rows of each row and add their values to a new column Question: I have a dataframe that contains multiple hierarchy columns and a value attach to them, something like this: location hierarhcy industry hierarchy value 0 US All V1 1 US-California All V2 2 US-California All-HT V3 3 US-California-LA All V4 …