def g10_plot_gdp_cpi_une(self, start_date, finish_date, data_type='cpi'): country_group = 'g10' if data_type == 'cpi': df = self.get_CPI_YoY(start_date, finish_date, country_group) elif data_type == 'gdp': df = self.get_GDP_QoQ(start_date, finish_date, country_group) elif data_type == 'une': df = self.get_UNE(start_date, finish_date, country_group) df = self.hist_econ_data_factory.grasp_coded_entry(df, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'world' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'world' gp.plotly_projection = 'Mercator' gp.plotly_world_readable = False gp.plotly_url = country_group + "-" + data_type gp.title = "G10 " + data_type gp.units = '%' pf.plot_generic_graph(df, type='choropleth', adapter='plotly', gp=gp)
def usa_plot_une(self, start_date, finish_date): country_group = 'usa-states' source = 'bloomberg' une = self.get_UNE(start_date, finish_date, country_group, source='bloomberg') une = self.hist_econ_data_factory.grasp_coded_entry(une, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'USA-states' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'usa' gp.plotly_projection = 'albers usa' gp.plotly_world_readable = False gp.plotly_url = country_group + "-unemployment" gp.title = "USA Unemployment" gp.units = 'pc' pf.plot_generic_graph(une, type='choropleth', adapter='plotly', gp=gp)
def g10_plot_gdp_cpi_une(self, start_date, finish_date, data_type = 'cpi'): country_group = 'g10' if data_type == 'cpi': df = self.get_CPI_YoY(start_date, finish_date, country_group) elif data_type == 'gdp': df = self.get_GDP_QoQ(start_date, finish_date, country_group) elif data_type == 'une': df = self.get_UNE(start_date, finish_date, country_group) df = self.hist_econ_data_factory.grasp_coded_entry(df, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'world' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'world' gp.plotly_projection = 'Mercator' gp.plotly_world_readable = False gp.plotly_url = country_group + "-" + data_type gp.title = "G10 " + data_type gp.units = '%' pf.plot_generic_graph(df, type = 'choropleth', adapter = 'plotly', gp = gp)
def usa_plot_une(self, start_date, finish_date): country_group = 'usa-states'; source = 'bloomberg' une = self.get_UNE(start_date, finish_date, country_group, source = 'bloomberg') une = self.hist_econ_data_factory.grasp_coded_entry(une, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'USA-states' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'usa' gp.plotly_projection = 'albers usa' gp.plotly_world_readable = False gp.plotly_url = country_group + "-unemployment" gp.title = "USA Unemployment" gp.units = 'pc' pf.plot_generic_graph(une, type = 'choropleth', adapter = 'plotly', gp = gp)
def europe_plot_une(self, start_date, finish_date): country_group = 'all-europe' une = self.get_UNE(start_date, finish_date, country_group) une = self.hist_econ_data_factory.grasp_coded_entry(une, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'europe' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'europe' gp.plotly_projection = 'Mercator' gp.plotly_world_readable = False gp.plotly_url = country_group + "-unemployment"; gp.title = "Europe Unemployment" gp.units = '%' pf.plot_generic_graph(une, type = 'choropleth', adapter = 'plotly', gp = gp)
def world_plot_cpi(self, start_date, finish_date): country_group = 'world-liquid' cpi = self.get_CPI_YoY(start_date, finish_date, country_group) cpi = self.hist_econ_data_factory.grasp_coded_entry(cpi, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'world' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'world' gp.plotly_projection = 'Mercator' gp.plotly_world_readable = False gp.plotly_url = str(country_group) + "-cpi" gp.title = "World Liquid CPI YoY" gp.units = '%' pf.plot_generic_graph(cpi, type='choropleth', adapter='plotly', gp=gp)
def europe_plot_une(self, start_date, finish_date): country_group = 'all-europe' une = self.get_UNE(start_date, finish_date, country_group) une = self.hist_econ_data_factory.grasp_coded_entry(une, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'europe' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'europe' gp.plotly_projection = 'Mercator' gp.plotly_world_readable = False gp.plotly_url = country_group + "-unemployment" gp.title = "Europe Unemployment" gp.units = '%' pf.plot_generic_graph(une, type='choropleth', adapter='plotly', gp=gp)
def world_plot_cpi(self, start_date, finish_date): country_group = 'world-liquid' cpi = self.get_CPI_YoY(start_date, finish_date, country_group) cpi = self.hist_econ_data_factory.grasp_coded_entry(cpi, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'world' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'world' gp.plotly_projection = 'Mercator' gp.plotly_world_readable = False gp.plotly_url = str(country_group) + "-cpi" gp.title = "World Liquid CPI YoY" gp.units = '%' pf.plot_generic_graph(cpi, type = 'choropleth', adapter = 'plotly', gp = gp)
df = hist.get_economic_data_history(start_date, finish_date, country_group, data_type, source=source) df = df.fillna(method='pad') if yoy_ret is True: df = 100 * (df / df.shift(freq) - 1) df = hist.grasp_coded_entry(df, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'USA-states' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'usa' gp.plotly_projection = 'albers usa' gp.plotly_url = country_group + data_type.replace(' ', '-') gp.plotly_world_readable = False gp.title = title gp.units = 'Value' # do a map plot by US state pf.plot_generic_graph(df, type = 'choropleth', adapter = 'cufflinks', gp = gp) #### uses CommonEconDataFactory to get more common forms of economic data and plot #### if True: logger = LoggerManager.getLogger(__name__) cedf = CommonEconDataFactory()
source=source) df = df.fillna(method='pad') if yoy_ret is True: df = 100 * (df / df.shift(freq) - 1) df = hist.grasp_coded_entry(df, -1) from chartesians.graphs import PlotFactory from chartesians.graphs.graphproperties import GraphProperties gp = GraphProperties() pf = PlotFactory() gp.plotly_location_mode = 'USA-states' gp.plotly_choropleth_field = 'Val' gp.plotly_scope = 'usa' gp.plotly_projection = 'albers usa' gp.plotly_url = country_group + data_type.replace(' ', '-') gp.plotly_world_readable = False gp.title = title gp.units = 'Value' # do a map plot by US state pf.plot_generic_graph(df, type='choropleth', adapter='cufflinks', gp=gp) #### uses CommonEconDataFactory to get more common forms of economic data and plot #### if True: logger = LoggerManager.getLogger(__name__) cedf = CommonEconDataFactory()