Answers for "dataframe pandas index value"

0

how to get the index of a value in pandas dataframe

print(df[df[‘Name’]==’Donna’].index.values)
Posted by: Guest on July-21-2021
0

pandas df.index.values

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)
Posted by: Guest on May-14-2021

Code answers related to "dataframe pandas index value"

Browse Popular Code Answers by Language