How to set in pandas the first column and row as index? February 13, 2023 by Tarik You can try this regardless of the number of rows df = pd.read_csv('data.csv', index_col=0)