📜  pandas df.index.values - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:16.828000             🧑  作者: Mango

代码示例1
df = pd. read_csv("fruits.csv")
print(df)
index = df. index.
condition = df["fruit"] == "apple"
apples_indices = index[condition] get only rows with "apple"
apples_indices_list = apples_indices. tolist()
print(apples_indices_list)