Run ❯
Get your
own Python
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import pandas as pd data = { "name": ["Sally", "Mary", "John"], "age": [50, 40, 30], "qualified": [True, False, False] } idx = ["X", "Y", "Z"] df = pd.DataFrame(data, index=idx) newdf = df.reset_index() print(newdf)
index name age qualified 0 X Sally 50 True 1 Y Mary 40 False 2 Z John 30 False