def dist1(): df= data_clean() fig = go.Figure([go.Bar(x=df['horsepower'], y=df_group)]) fig.show() fig_json = json.dumps(fig , cls=plotly.utils.PlotlyJSONEncoder) return fig_json
def data(): data = data_clean() return render_template ('data.html', data=data)
def stats(): data = data_clean() return render_template('stats.html', data=data)
def data(): data = data_clean().head() return render_template('table_data.html', data=data)
def neighbourhood_plots(): df = data_clean() df_group = df['neighbourhood_cleansed'].value_counts() fig = go.Figure([go.Bar(x=df_group.index, y=df_group.values)]) fig_json = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) return fig_json
def property_type_price(): df = data_clean() fig = px.box(df, x="property_type", y="price") fig_json = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) return fig_json
def Weekend_price(): df = data_clean() fig = px.box(df, x="Weekend", y="price") fig_json = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) return fig_json
def neighbourhood_price(): df = data_clean() fig = px.box(df, x="neighbourhood_cleansed", y="price") fig_json = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) return fig_json
def property_plots(): df = data_clean() df_group = df['property_type'].value_counts() fig = go.Figure([go.Bar(x=df_group.index, y=df_group.values)]) fig_json = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) return fig_json