I have a dataframe like this
data=
I want to do a group by operation on "nm" and trying to achieve a json structure like below