0

I have a DataFrame that needs to be converted to a HTML file. The DataFrame can be quite large and it contains images. I saw this thread which works for smaller DataFrames but mine tend to be around 10k-20k rows (with images) so the html file just loads and loads but eventually crashes.

Is there a way to just load the images and text for each page individually rather than the page trying to load everything at once?

Or is there another method for creating a HTML file from a Pandas DataFrame that would work with a large DataFrame containing image tags?

Tylerr
  • 201
  • 2
  • 12

1 Answers1

0

Yes, use the 'to_html()' method. Here's an example.

import pandas as pd

df=pd.read_csv('name of file')
df.to_html('name.htm')
  • Yeah, I am aware of this, but the resulting html file will not work as the dataframe is too large. So I need something that wouldn't try to load the whole dataframe at once. The linked thread uses pagination so it would be nice if I could just load when you go to the next page. – Tylerr Jun 26 '19 at 23:41