dataframe_image
dataframe_image copied to clipboard
when argument table_conversion = 'matplotlib' of export functions,the dataframe's set_caption will not work.
when I run below code on my macbook,everything is Ok;
helper = WxMsgHelper()
current_date = datetime.datetime.now().strftime('%Y-%m-%d')
for user_name in user_tables_map:
df1 = df[df.createby.str.contains(fr'\b{user_name}\b', regex=True, case=False)]
if len(df1) > 10:
df_styled = df1.style.background_gradient()
df_styled = df_styled.set_caption('<b>time:{}<br>'.format(current_date))
dfi.export(df_styled,"{}.png".format(user_name),max_rows=-1)
helper.send_wx_image('zds', "{}.png".format(user_name))
break
when I run below code on my macbook, the caption of table lost.
helper = WxMsgHelper()
current_date = datetime.datetime.now().strftime('%Y-%m-%d')
for user_name in user_tables_map:
df1 = df[df.createby.str.contains(fr'\b{user_name}\b', regex=True, case=False)]
if len(df1) > 10:
df_styled = df1.style.background_gradient()
df_styled = df_styled.set_caption('<b>time:{}<br>'.format(current_date))
dfi.export(df_styled,"{}.png".format(user_name),max_rows=-1,,table_conversion = 'matplotlib')
helper.send_wx_image('zds', "{}.png".format(user_name))
break
Does anyone know how to set_caption when I set table_conversion = 'matplotlib'.
Is this resolved? I am facing similar issue
I am facing the same issue. table_conversion="chrome"
works with set_caption
but matplotlib does not.
matplotlib
is a simulation method. We actually create rectangle as cells and then combine them together.
So if set_caption
need to work, it will take a lot of effort to simulate that.
This feature is planned but will not release soon.
BTW, if anyone can provide a PR would be very helpful.
Supported by https://github.com/dexplo/dataframe_image/commit/45fda8db7e18de806b3743aa9dd7ddb5b300fff9
Will release soon
Released: https://github.com/dexplo/dataframe_image/releases/tag/v0.2.4