• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: pandas- convert/transpose columns to rows without using loop

Resolved: pandas- convert/transpose columns to rows without using loop

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am trying to convert/tranpose a very wide dataframe to a row-based dataframe (for lack of better word).
The origin table looks like this
I can easily transpose it in loop
In this way the dataframe looks like:
So my question is how to convert/transpose the table without using loop?
I got a really long list, I believe using loop is a bit slow here.
Thank you !!!!

Answer:

Let us try wide_to_long

If you have better answer, please add a comment about this, thank you!

loops pandas python transpose
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How do I stop the command from happening if the requirements for it to work aren’t sert Discord.js

02/04/2023

Resolved: How to scroll bottom of div at launch?

02/04/2023

Resolved: how to get and read an xml file in a zip file using xml.etree

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.