def graph_report(start_date, end_date): for tbl_name, tbl_info in daily_config.items(): date_name = 'Date' df = util.df_with_query(tbl_name, date_name, start_date, end_date) # print(df) if df.empty: error = "Table: {}, No record for {} - {}".format(tbl_name, start_date, end_date) print(error) continue return error y_axis = tbl_info['y_axis'] util.plot_monthly(df[date_name], df[y_axis], tbl_name, start_date, end_date)
import Report.util_daily_report as util tbl_name = 'google_fit' date_name = 'Date' start_date = '2017-01-01' end_date = '2017-05-01' #23/07/2017 y_axis = 'Step count' df = util.df_with_query(tbl_name, date_name, start_date, end_date) util.plot_monthly(df[date_name], df[y_axis], tbl_name)
import Report.util_daily_report as util date_name = 'Date' """ # start_date = '2014-08-02' # end_date = '2017-08-23' start_date = '2017-01-01' end_date = '2017-08-23' tbl_name = 'sleep' y_axis = 'total_hours' df = util.df_with_query(tbl_name, date_name, start_date, end_date) util.plot_monthly(df[date_name], df[y_axis], tbl_name, start_date, end_date) """ # # start_date = '2017-04-11' # end_date = '2017-08-24' # # tbl_name = 'pomo_excel_daily' # y_axis = 'pomo_total' # # df = util.df_with_query(tbl_name, date_name, start_date, end_date) # util.plot_monthly(df[date_name], df[y_axis], tbl_name, start_date, end_date) # #
# end_date = '2017-01-31' start_date = '2017-02-01' end_date = '2017-02-28' # start_date = '2017-03-01' # end_date = '2017-03-31' # start_date = '2017-04-01' # end_date = '2017-04-30' tbl_name = 'weather_daily' y_axis = 'Temp_mean' df = util.df_with_query(tbl_name, date_name, start_date, end_date) util.plot_monthly(df[date_name], df[y_axis], tbl_name, start_date, end_date) tbl_name = 'google_fit' y_axis = 'Step count' df = util.df_with_query(tbl_name, date_name, start_date, end_date) util.plot_monthly(df[date_name], df[y_axis], tbl_name, start_date, end_date, style='seaborn-darkgrid') tbl_name = 'mood' y_axis = 'mood'