Run ❯
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import pandas as pd data = { "name": ["Sally", "Mary", "John", "Monica"], "age": [50, 40, 30, 40], "qualified": [True, False, False, False] } df = pd.DataFrame(data) newdf = df.set_index('name') print(newdf)
age qualified name Sally 50 True Mary 40 False John 30 False Monica 40 False