vendredi 23 décembre 2016

Selecting a value from a python data frame if a condition is met

My data frame looks as follows:

df_data = pd.read_csv("SKU12345.csv", index_col=0)

where the CSV I refer to has the following values:

  SKU,Tag,Fall,Wert  
 0,12345,1,WE,1000
 1,12345,1,ABV,10
 2,12345,1,PRO,0
 3,23456,2,WE,10000

I want to make an if-condition which reads as follows:

If 'Fall' == 'WE' 
and if 'Wert' of this row > 100:
print('Wert' of row with 'Fall' == 'WE')

The outcome I wish to get is

1000
10000

Thank you so much!

Aucun commentaire:

Enregistrer un commentaire