how to get the last index of a series in python code example
Example 1: call for a last number in series python
print (df.iloc[-1, df.columns.get_loc('col1')])
3
print (df.iat[-1, df.columns.get_loc('col1')])
3
Example 2: call for a last number in series python
print (df['col1'].iloc[-1])
3
print (df['col1'].iat[-1])
3