Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #rows #column
ADD COMMENT
Topic
Name
6+8 =