- Daily Dose of Data Science
- Posts
- An Interesting and Lesser-Known Way To Create Plots Using Pandas
An Interesting and Lesser-Known Way To Create Plots Using Pandas
Whenever you print/display a DataFrame in Jupyter, it is rendered using HTML and CSS. This allows us to format the output just like any other web page.
One interesting way is to embed inline plots which appear as a column of a dataframe.
In the above snippet, we first create a plot as we usually do. Next, we return the <img> HTML tag with its source as the plot. Lastly, we render the dataframe as HTML.
Find the code for this tip here: Notebook.
Share this post on LinkedIn: Post Link.
Find the code for my tips here: GitHub.
Reply