Is there a way to embed pandas analysis into a html page?

Question:

I’ve done some analysis using Pandas on a csv file and have created a number of graphs using matplotlib and plotly.

I’m trying to get these graphs in a html page so my team can see them on a dashboard.

I know it’s possible to download the image and embed into html, however, the csv file I performed my analysis on will be constantly updated i.e. I need a way of include the graphs on a html page which auto refreshes.

Is this possible?

Asked By: lostcoder

||

Answers:

I think it would be possible and check pyscrpit

https://pyscript.net/

where you can use python in html

https://github.com/pyscript/pyscript/blob/main/docs/tutorials/getting-started.md

here are some tutorials to get and idea of what I am talking about and to start

Then you can host the html page anywhere you like and they will see when you update it

Answered By: Ali Redha

Voila or Panel to make a dashboard is another way to go. That needs an active Python kernel at this time. (That is as opposed to the pyscript / webassembly route. JupyterLite currently works in WASM and Voila in WASM is in development. ===> Update: Voila/JupyterLite = Voici(March 2023) Examining demonstrations available at the Voila Gallery will give you a sense of how it can work. All those example demos are served via MyBinder. And you can use that too, if your code and data can be public. If it cannot be public, you’d need to host a server that only your team can access.

JupyterLite would also be possible if you don’t mind your team being able to see the code cells and things that compose your Jupyter notebook stepping through the analysis. That would not require an active Python kernel server-side because it is based on WebAssembly that would run inside the client machine, like PyScript. So all you would need to do was a have a server that can serve static files. That’s a lower bar than Voila that would run on the server. How to get started deploying JupyterLite is here.

Answered By: Wayne

I would checkout out Dash or Plotly, here you can add generation of the graphs in a callback for isntace. Which would update them when the .csv updates. Good luck!

Answered By: felrock
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.