Is it possible to change the text color for a specific row when using df.to_markdown()
?
I have attempted using df.style.apply([styles]).to_markdown()
but does does not work since it converts the df into an styler object.
code:
print(labels_data.to_markdown(headers= df.columns, tablefmt="jira", showindex=True))
df styled code:
def row_name(x):
for i in x:
if x.name=='Control':
return ['background: yellow']
else:
return ''
labels_data = count_labels(labels).sort_values('% meets', ascending=False)
labels_data.style.apply(lambda x: ['background: lightgreen'
if (x.name == 'control')
else '' for i in x], axis=1)
My use case is printing a markdown to copy paste a table (with styles) in jira.
Thanks