运行 ❯
获取一个
属于自己的 Python
服务器
×
更改方向
更改主题,浅色/深色
转到 Spaces
import pandas as pd data = [[50, True], [40, False], [30, False]] label_rows = ["Sally", "Mary", "John"] label_cols = ["age", "qualified"] df = pd.DataFrame(data, label_rows, label_cols) print(df.loc["Mary", "age"])
40