Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Python :: Find From Table Django 
Python :: Set Date In Python 
Python :: Sending Data in Unstructured File Form 
Python :: 3x4 matrix 
Python :: Python script to do something at the same time every day 
Python :: jntuk r20 1-2 python lab manual 
Python :: slice all elements from list 
Python :: geopandas bbox 
Python :: Boolean comparison w/out if statements 
Python :: python set xticks to int not float 
Python :: Python - Common Conditional Statements 
Python :: python extract extension 
Python :: Python Program to Display Powers of 2 Using Anonymous Function 
Python :: python get screen dpi 
Python :: Django forms I cannot save picture file 
Python :: how to delete lists after using them in python 
Python :: machine learning project outline 
Python :: how to write flow of execution in python 
Python :: python selenium firefox handle ssl bypass 
Python :: grouped bar chart with labels 
Python :: python messaging networking 
Python :: numpy index array all except 
Python :: print class name python 
Python :: flask pass an array of dicts 
Python :: python reverse list every 2 element 
Python :: tornado cookies authorization 
Python :: disable kivy button in kv 
Python :: pairwiseclip arcpy 
Python :: x and y in python 
Python :: generating cross tables after clustering 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =