def add_priceoverbedbath(df): df = add_features(df) df["price_over_bedbath"] = df['price'] / (df['bathrooms'] + df['bedrooms']) df["price_over_bedbath"] = [ np.min([1000000, x]) for x in df['price_over_bedbath'] ] return df
def add_bath2(df): df = add_features(df) df["bathrooms2"] = df["bathrooms"].apply(lambda x: x**2) return df
def add_priceoverbed(df): df = add_features(df) df["price_over_bed"] = df['price'] / df['bedrooms'] df["price_over_bed"] = [np.min([1000000, x]) for x in df['price_over_bed']] return df
def add_price2(df): df = add_features(df) df["price2"] = df["price"].apply(lambda x: x**2) return df