I have a dataframe where there are 4 columns representing id, name, parent id and level respectively, something like below
enter image description here
reason