Skip to content
Advertisement

Tag: unpivot

Pandas ‘partial melt’ or ‘group melt’

I have a DataFrame like this and I want to transform it into something like this This is an unpivot / melt problem, but I don’t know of any way to melt by keeping these groups intact. I know I can create projections across the original dataframe and then concat those but I’m wondering if I’m missing some common melt

Advertisement