Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas swapaxes example

import pandas as pd
df = pd.DataFrame({"A":[10, 11, 7, 8, 5], 
                   "B":[21, 5, 32, 4, 6], 
                   "C":[11, 21, 23, 7, 9], 
                   "D":[1, 5, 3, 8, 6]},  
                   index =["A1", "A2", "A3", "A4", "A5"])
dataframe.swapaxes(axis1="index", axis2="columns")
Comment

PREVIOUS NEXT
Code Example
Python :: python - calculate the value range on a df 
Python :: jsonschema in python 
Python :: how to concatenate a string with int in python 
Python :: Iterate through characters of a string in python 
Python :: regex remove all html tags except br python 
Python :: python get the app path 
Python :: pandas dataframe to series 
Python :: python keyboard key codes 
Python :: xticks and yticks matplotlib 
Python :: downsample image opencv 
Python :: get every item but the last item of python list 
Python :: change item in list python 
Python :: pip uninstalled itself 
Python :: python detect warning 
Python :: python sockets 
Python :: np.select with multiple conditions 
Python :: how to save dataframe as csv in python 
Python :: how to get key value in nested dictionary python 
Python :: pandas merge two dataframes remove duplicates 
Python :: index from multiindex pandas 
Python :: int to alphabet letter python 
Python :: python array 
Python :: find all indices of element in string python 
Python :: setattr python 
Python :: how to log errors while debug is false in django 
Python :: python join list ignore none and empty string 
Python :: python async function 
Python :: sum of list in python 
Python :: list of dict values 
Python :: how to run shell command in python 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =