运行 ❯
获取
你自己的 Python
服务器
×
更改方向
更改主题,暗/亮
转到 Spaces
import pandas as pd data = { "name": ["Sally", "Mary", "John"], "age": [50, 40, 30], "qualified": [True, False, False] } df = pd.DataFrame(data) newdf = df.rename_axis("members") print(newdf)
name age qualified members 0 Sally 50 True 1 Mary 40 False 2 John 30 False