Check if the dataframe ID or indexing is starting from 0 or 1. Change for loop range value accordingly