Getting Last N Rows Of Column

[Solved] Getting Last N Rows Of Column | Vb - Code Explorer | yomemimo.com
Question : getting last n rows of column

Answered by : harish-vasanth

# 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 : https://www.geeksforgeeks.org/get-last-n-records-of-a-pandas-dataframe/ | Last Update : Sun, 20 Mar 22

Answers related to getting last n rows of column

Code Explorer Popular Question For Vb