I have styled a dataframe output and have gotten it to display how I want it in a Jupyter Notebook but I am having issues find a good way to save this as an image. I have tried https://pypi.org/project/dataframe-image/ but the way I have this working it seem to be a NoneType as it's a styler object and errors out when trying to use this library.
This is just a snippet of the whole code, this is intended to loop through several 'col_names' and I want to save these as images (to explain some of the coding).
import pandas as pd
import numpy as np
col_name = 'TestColumn'
temp_df = pd.DataFrame({'TestColumn':['A','B','A',np.nan]})
t1 = (temp_df[col_name].fillna("Unknown").value_counts()/len(temp_df)*100).to_frame().reset_index()
t1.rename(columns={'index':' '}, inplace=True)
t1[' '] = t1[' '].astype(str)
display(t1.style.bar(subset=[col_name], color='#5e81f2', vmax=100, vmin=0).set_table_attributes('style="font-size: 17px"').set_properties(
**{'color': 'black !important',
'border': '1px black solid !important'}
).set_table_styles([{
'selector': 'th',
'props': [('border', '1px black solid !important')]
}]).set_properties( **{'width': '500px'}).hide_index().set_properties(subset=[" "], **{'text-align': 'left'}))