vendredi 28 décembre 2018

How to show graphs from python program to a website?

I have a python file which plots graphs. I want to import that file to web-page which I want to make. Which tool will be better to make that web-page. It should be like, when i press some button the graph appears in a div or Iframe or another popup page.

The following code create a graph. I want to show the graph in website

import pandas as pd

import dateutil

def gen(file,data):

lists = pd.read_csv(file)    

lists['obstime'] = lists['obstime'].apply(dateutil.parser.parse, dayfirst=True)

lists = lists[lists[data] > -273]

daily_avg_temp = lists.set_index('obstime').groupby(pd.Grouper(freq='D'))[data].mean()

monthly_avg_temp = daily_avg_temp.groupby(pd.Grouper(freq='M')).mean()
monthly_avg_temp.plot()

gen(file_name,d)




Aucun commentaire:

Enregistrer un commentaire