The index may be disturbed while manipulating the dataframe such as deleting rows or joining. In this case, if you want to reassign the index from 0, use reset_index (drop = True).
reset_index.py
rssi_data = rssi_data.reset_index(drop=True)
Example
before.py
print window_data.head()
t dist(8) dist(9) dist(10) dist(11) dist(12)
13 12:55:26.600 2.362109 2.369736 2.031889 1.240509 0.860399
14 12:55:26.800 2.336146 2.385064 1.986095 1.210598 0.847227
15 12:55:27.000 2.312065 2.412682 1.936422 1.180321 0.835603
16 12:55:27.200 2.289813 2.441181 1.891472 1.154516 0.823569
17 12:55:27.400 2.269342 2.470586 1.850973 1.132922 0.811148
index reassignment
after.py
window_data = window_data.reset_index(drop=True)
print window_data.head()
t dist(8) dist(9) dist(10) dist(11) dist(12)
0 12:55:26.600 2.362109 2.369736 2.031889 1.240509 0.860399
1 12:55:26.800 2.336146 2.385064 1.986095 1.210598 0.847227
2 12:55:27.000 2.312065 2.412682 1.936422 1.180321 0.835603
3 12:55:27.200 2.289813 2.441181 1.891472 1.154516 0.823569
4 12:55:27.400 2.269342 2.470586 1.850973 1.132922 0.811148
Recommended Posts