Is there a way to add or subtract to an existing dataframe?
For example, given the code below:
import pandas as pd
Apple= pd.DataFrame({'Product':['MacBook', 'iPhone', 'iPad', 'Apple Watch'],
'Inventory':['999', '333', '666', '190']})
Is there a way to add 150 to an existing inventory so that the number of Apple Watches is 340?
Apple.loc[Apple.Product.eq('Apple Watch'), 'Inventory'] += 150pandas