Using popular Python visualization libraries, it can be relatively easy to create local charts and dashboards in a variety of ways. Although it can be much more complicated to share the results with other people on the web.
One possible approach to do this is to use libraries like Streamlit, Flask, Plotly Dash and pay for a web hosting service to cover the server side and run your Python scripts to display them on the web page. Alternatively, some providers like Plotly Chart or Datapane also provide free cloud support for you to upload your Python visualizations and then embed them on the web. In both scenarios, you will be able to achieve anything you need if you have a small budget for your project, but is there a way we can achieve similar results for free?
As part of this article, we will explore 3 possible approaches:
To demonstrate each of these 3 approaches, let’s create a simple application to explore historical inflation data from around the world. For this we are going to use The World Bank’s global inflation database All information about data licensing can be found at this link (1).
Once the data is downloaded, we can use the following preprocessing function to better shape the data set for visualization and import only the 3 Excel sheets that we will use as part of the analysis (general inflation data, food inflation and food prices). energy).
import pandas as pddef import_data(name):
df = pd.read_excel("Inflation-data.xlsx", sheet_name=name)
df = df.drop(("Country Code", "IMF Country Code", "Indicator Type", "Series Name", "Unnamed: 58"), axis=1)
df = (df.melt(id_vars = ('Country', 'Note'),
var_name = 'Date', value_name = 'Inflation'))
df = df.pivot_table(index='Date', columns='Country',
values='Inflation', aggfunc='sum')
return df
inf_df = import_data("hcpi_a")
food_df = import_data("fcpi_a")
energy_df = import_data("ecpi_a")