📅  最后修改于: 2022-03-11 14:47:16.828000             🧑  作者: Mango
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)