def single_product_investigated(): title= 'The number of each product have been tested' amount = qst.exec_qst2(data) return wv.render_template('answers.html', data=amount.to_html(), title = title )
def year_of_cheapest_tuna(): title= 'The year of cheapest tuna was' cheapest = qst.exec_qst3(data,df) return wv.render_template('answers.html', data=cheapest.to_html(), title = title)
def show_data(): return wv.render_template('answers.html', data=df.to_html())
def total_products_investigated(): title= 'The number of products have been tested' result = qst.exec_qst1(df) return wv.render_template('answers.html', data=result, title = title )
def top_10_most_expensive_products(): title = 'The list of top 10 most expensive food products' filtered_frame = qst.excec_qst8(data) return wv.render_template('answers.html', data=filtered_frame.to_html(), title = title)
def kiwi_prices_2013(): title = 'The list of prices for kiwi in 2013 ($)' kiwi = qst.excec_qst13(data,df) return wv.render_template('answers.html', data=kiwi.to_html(), title = title)
def home_page(): return wv.render_template('index.html')
def most_expensive_product(): title = 'The most expensive product is' expensive = qst.exec_qst6(data) return wv.render_template('answers.html', data=expensive.to_html(), title = title)
def lettuce_prices_2013(): title = 'The prices for lettuce in 2013' lettuce = qst.excec_qst17(data,df) return wv.render_template('answers.html', data=lettuce.to_html(), title = title)
def test(): title = 'The prices for 500g canned Soup in 2017' lettuce = qst.excec_test(data,df) return wv.render_template('answers.html', data=lettuce.to_html(), title = title)
def banana_prices_2013(): title = 'The prices for bananas in 2013' banana = qst.excec_qst16(data,df) return wv.render_template('answers.html', data=banana.to_html(), title = title )
def apple_prices_2013(): title = 'The prices for apples in 2013' apple = qst.excec_qst15(data,df) return wv.render_template('answers.html', data=apple.to_html(), title = title)
def top_10_most_expensive_kiwi(): title = 'The top 10 most expensive list of kiwi (1 kg)' kiwi = qst.excec_qst14(data,df) return wv.render_template('answers.html', data=kiwi[:10].to_html(), title= title)
def year_of_most_expensive_tuna(): title= 'The year of most expensive tuna was:' expensive = qst.exec_qst4(data,df) return wv.render_template('answers.html', data=expensive.to_html(), title = title)
def show_answers(): return wv.render_template('answers.html')
def most_cheapest_product(): title= 'The most cheapest product is' cheapest = qst.exec_qst5(data) return wv.render_template('answers.html', data=cheapest.to_html(), title = title )
def plot_page(): return wv.render_template('plot.html')
def top_10_cheapest_products(): title = 'The list of top 10 cheapest food products' filtered_frame = qst.excec_qst7(data) return wv.render_template('answers.html', data=filtered_frame.to_html(), title = title)
def info_page(): return wv.render_template('info.html')
def average_price_bananas_2012(): title = 'The average price for 1 kg bananas in 2012 is ($)' average = qst.excec_qst9(data,df) return wv.render_template('answers.html', data=round(average,3), title = title)
def price_for_carrots_march_2013(): title = 'The price for 1 kg carrots in marts 2013 is ($)' carrot = qst.excec_qst12(data,df) return wv.render_template('answers.html', data=carrot.to_html(), title = title)