When I read in a CSV, I can say pd.read_csv(\'my.csv\', index_col=3) and it sets the third column as index.
pd.read_csv(\'my.csv\', index_col=3)
How can I do the same if I have a pandas datafra
You can try this regardless of the number of rows
df = pd.read_csv('data.csv', index_col=0)