pandas df index values

Solutions on MaxInterview for pandas df index values by the best coders in the world

showing results for - "pandas df index values"
Max
28 Oct 2016
1df = pd. read_csv("fruits.csv")
2print(df)
3index = df. index.
4condition = df["fruit"] == "apple"
5apples_indices = index[condition] get only rows with "apple"
6apples_indices_list = apples_indices. tolist()
7print(apples_indices_list)