Index is an object, and default index starts from 0
:
>>> result.index
Int64Index([0, 1, 2], dtype=int64)
You can shift this index by 1
with
>>> result.index += 1
>>> result.index
Int64Index([1, 2, 3], dtype=int64)
from : https://stackoverflow.com/questions/20167930/start-index-at-1-for-pandas-dataframe
No comments:
Post a Comment