Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

reverse row order padnas

import pandas as pd

df = pd.DataFrame({'a':[1,2,3],
                   'b':[4,5,6,],
                   'c':[7,8,9,]})

df_col_reverse = df.loc[:, ::-1] # reverse column order
df_row_reverse = df.loc[::-1, :] # reverse row order
Comment

PREVIOUS NEXT
Code Example
Python :: code help 
Python :: turtle meaning 
Python :: diamond shape alphabatical pattern program in python 
Python :: remove stopwords python 
Python :: macos youtube-dl unable to get local issuer certificate _ssl.c:1131 
Python :: multiplication table in python 
Python :: alexa in python 
Python :: how travel a list invertida in python 
Python :: rename column in dataframe 
Python :: pandas exploring dataframe 
Python :: pyplot common labels 
Python :: django edit model without loading from db 
Python :: demploy django in vps 
Python :: django create superuser with first_name 
Python :: python import problem fix 
Python :: The simplest way to start using doctest in python 
Python :: A Simple Class 
Python :: permutation test python 
Python :: rmtree (remove tree) example 
Python :: Print feature importance per feature 
Python :: scrapping components of webpage 
Python :: python get the X charecters at the end of a string 
Python :: when to register app in django 
Python :: gensim loop keyed vector 
Python :: Python | Set 3 (Strings, Lists, Tuples, Iterations) 
Python :: assert isinstance python 
Python :: json object type in python 
Python :: Python create time slot within duration 
Python :: how to filter even or odd model id in django 
Python :: how do i re-restablish the third reich 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =