
df = pd.DataFrame({
'Type':['Apple', 'Pear', 'Orange', 'Grape', 'Banana', 'Lemon', 'Watermelon', 'Tomato'], 'Price':[25, 10, 15, 30, 12, 15, 30, 20]})
print(df)

row_index = df[df.Type == 'Watermelon'].index.tolist()[0]
print(row_index)

Watermelon_price = df['Price'][row_index]
print(Watermelon_price)

import pandas as pd
df = pd.DataFrame({
'Type': ['Apple', 'Pear', 'Orange', 'Grape', 'Banana', 'Lemon', 'Watermelon', 'Tomato'], \
'Price': [25, 10, 15, 30, 12, 15, 30, 20]})
print(df)
row_index = df[df.Type == 'Watermelon'].index.tolist()[0]
print(row_index)
Watermelon_price = df['Price'][row_index]
print(Watermelon_price)


Python data correlation mapping - the return of the scatterplot normal distribution diagram and irises dataset visualization (with the python code)
背景描述Data analysis is inseparab