IndexError: index 151 is out of bounds for axis 0 with size 151 : help me with error please? and how to save the output from print function to dataframe?




    from haversine import haversine
    import pandas as pd

    dataframe = pd.read_csv("gpsdataedit.csv", delimiter = None)
    dataset = dataframe.values
    n = 0
    c = 0
    b = 1
    a = dataset

    for value in  enumerate(dataset) :
        c = c + 1
    b = b +1
    n = n + 1
    distance = haversine(a[c], a[b]).km
    print(distance)
    Traceback (most recent call last):
    File "/home/rr/PycharmProjects/GPS/trydistance.py", line 32, in <module>
    distance = haversine(a[c], a[b]).km
    IndexError: index 151 is out of bounds for axis 0 with size 151

