Set the name column as the index of the DataFrame.
DataFrame df with columns: name, department, salary, age, city
name column as the DataFrame indexname column should no longer appear as a regular columnReady to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.