mercedestrenz.visualizations

Module Contents

Functions

plot_mercedes_price(model, price, market_df[, ...])

Plot a density plot of a specific Mercedes-Benz model to see where

mercedestrenz.visualizations.plot_mercedes_price(model, price, market_df, model_col='model', price_col='price_USD')[source]

Plot a density plot of a specific Mercedes-Benz model to see where the current vehicle’s price falls within the distribution of prices for that model in the market.

Parameters:
  • model (str) – The model of the vehicle.

  • price (float) – The price of the vehicle.

  • market_df (pandas.DataFrame) – Dataframe containing information on used Mercedes-Benz in the market.

  • model_col (str) – The name of the column of model. (By default ‘model’)

  • price_col (str) – The name of the column of price. (By default ‘price_USD’)

Returns:

Density plot of prices for the specified Mercedes-Benz model.

Return type:

altair.Chart

Examples

>>> from mercedestrenz.visualizations import plot_mercedes_price
>>> plot_mercedes_price(model='S-Class', price=80000, market_df=market_df))
>>> plot_mercedes_price(model='C-Class', price=10000, market_df=used_car_df))