Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

getting last n rows of column

# Getting last 2 rows of columns 
# Age and Marks from df
df_last_2 = df[['Age', 'Marks']].tail(2)
  
# Printing df_last_2
print(df_last_2)
Comment

PREVIOUS NEXT
Code Example
Python :: from sklearn.metrics import confusion_matrix pred = model.predict(X_test) pred = np.argmax(pred,axis = 1) y_true = np.argmax(y_test,axis = 1) 
Python :: display column names as a dictionary pandas 
Python :: Python colon equals 
Python :: import combination 
Python :: install pytorch on nvidia jetson nx 
Python :: check pd.NaT python 
Python :: skcikit learn decision tree 
Python :: Iterate through string in python using for loop 
Python :: How split() works in Python? 
Python :: python overwrite multiline text 
Python :: stackoverflow python 
Python :: python zip 
Python :: python one line key increment or add 
Python :: pandas append sheet to workbook 
Python :: python append 
Python :: flask blueprints 
Python :: installing intel-numpy 
Python :: import tkinter module in python file 
Python :: Pivot Spark data frame using python 
Python :: python sh command 
Python :: response time in os 
Python :: python math 
Python :: remove deprecation warning python 
Python :: override get_queryset django with url parameters 
Python :: what is admin.tabularinline django 
Python :: how to display items on a list on new lines python 
Python :: tkinter label border color 
Python :: find a character in a string python last 
Python :: numeric up down python tkinter 
Python :: Generate hashed passwords for ansible 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =