set index while reading a file or after opening it

PHOTO EMBED

Sat Apr 01 2023 02:40:21 GMT+0000 (Coordinated Universal Time)

Saved by @lmacciomaretto

>>> df = pd.read_csv(..., index_col="BibNumber")
>>> df.set_index("BibNumber", inplace=True)
content_copyCOPY

https://towardsdatascience.com/8-things-you-should-know-when-dealing-with-pandas-indexes-70835198ac7c