Python Forum
How can I convert time-series data in rows into column - 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: How can I convert time-series data in rows into column (/thread-25763.html)



How can I convert time-series data in rows into column - srvmig - Apr-11-2020

Hi,
I have a data-set where the information is showing that certain item is sold in different date. The date mentioned in the rows as like below.
item_id item_name m_1 m_2 m_3
 a_1      a         1   2   0
 b_1      b         0   1   1
I need to convert the data into column line below.
item_id item_name month item_sold
a_1       a        m_1      1    
a_1       a        m_2      2    
a_1       a        m_3      0    
b_1       b        m_1      0    
b_1       b        m_2      1    
b_1       b        m_3      1    
Can any one help me please??