dataframe get last column code example
Example 1: pandas how to get last index
#using iget() function
df['column'].iget(-1)
#using index
df['date'][df.index[-1]]
#using iloc
df["date"].iloc[-1]
Example 2: get last column pandas
df.iloc[:,-1:]
Example 3: print last n rows of dataframe
df1.tail(n)