Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pyhton transpose without changing column and row names

df  = pd.DataFrame({'Store':[*'ABCDE'],
                    'Week 1':np.random.randint(50,200, 5), 
                    'Week 2':np.random.randint(50,200, 5),
                    'Week 3':np.random.randint(50,200, 5)})
 
df_out = df.set_index('Store').T
df_out
 
PREVIOUS NEXT
Tagged: #pyhton #transpose #changing #column #row #names
ADD COMMENT
Topic
Name
8+6 =