Python 2.7.11 // Pandas 0.18.1
I have a made up dataset (csv) to practice with for an imaginary liquor store with 250 items. The columns cover 'Brewery', 'Label', 'Year', 'Store Price', 'MSRP', 'Supplier Price', and a few others. However for this question, the relevant pieces are the Brewery and the Store Price (current price that is queried at checkout).
Brewery Store Price
104 Glenfiddich 109.99
105 Glenfiddich 89.99
108 Glenfiddich 114.99
110 Glenfiddich 99.99
119 Glenfiddich 169.99
If I were running a sale on Glenfiddich, I could locate the Glenfiddich items with something like this:
df = pd.read_csv('liquorStore.csv')
df.Brewery.str.contains('Glenfiddich')
I know how to find the Glenfiddich products but I do not know how to alter values of the row within the dataframe. For instance, I want to:
- Find 'Glenfiddich' items
- Adjust 'Store Price' to reflect a sale/new price (e.g. 10% off)
Note: I am just doing this to practice with pandas.