please I have a python script that produces multiple dataframes: df1, df2, ..., df10. I would need ideally to export those dataframes all in one single pdf file but I realized that is quite complex. Hence, I'm trying to export the different dataframes into one single html file using the df.to_html() function. However, how can I export all my datafames into the same html file?
import numpy as np
from numpy.random import randn
import pandas as pd
import matplotlib.pyplot as plt
df = pd.DataFrame(randn(5,4),columns='W X Y Z'.split())
df1 = pd.DataFrame(randn(5,4),columns='A B C D'.split())
df.head().to_html("testhtml.html")
df1.head().to_html("testhtml.html")
with the code above, the second .to_html instruction overrides the content of the first one, resulting with one single dataframe printed inside the html file. Is there any way to "append" the dataframes inside the same html file? Thank
