Python Forum
Help to control pandas.melt function - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Help to control pandas.melt function (/thread-40192.html)



Help to control pandas.melt function - vanphuht91 - Jun-17-2023

I’m using pandas to processing my raw data.
I have raw data like this:
[attachment=2420]

I want to convert some columns to row using pd.melt like this:
[attachment=2421]

But, I don’t know how to move USL & LSL transpose to 2 columns.
Can anyone help me.
Thanks so much!!!
My file:
Quote:https://docs.google.com/spreadsheets/d/1R-_4YZSXFa00ZewADVpSlmK1nSlETVDx/edit?usp=sharing&ouid=100090612001289608062&rtpof=true&sd=true