# 8.33:  Vectorizing with condition.  Continuing the above solution, use .loc[] with a condition to
# set 'tax' to 0.0625 for all 'NJ' rows, then recalculate tax amount.

import pandas as pd

df = pd.read_csv('../revenue.csv')

df['tax'] = 0.04

df.loc[ df.state == 'NJ', 'tax' ] = 0.06

df['tax amt'] = df.revenue * df.tax

print(df)

