Esempio n. 1
0
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
Esempio n. 2
0
def add_bath2(df):
    df = add_features(df)
    df["bathrooms2"] = df["bathrooms"].apply(lambda x: x**2)
    return df
Esempio n. 3
0
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
Esempio n. 4
0
def add_price2(df):
    df = add_features(df)
    df["price2"] = df["price"].apply(lambda x: x**2)
    return df