Python Forum

Full Version: How can I convert time-series data in rows into column
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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??