So what I'm trying to do is, based on content in column, set color for whole row (view image for context)
Example: If data in column Status is "Finished", then the color for that row is blue; for "Reading" the color is green etc.
My code:
import pandas as pd
df = pd.read_csv("data.txt", delimiter='|')
def colored_text():
if df.loc[df['Status'] == 'Reading']:
return 'color: green'
else:
return 'color: yellow'
df.style.applymap(colored_text)
print(df)
Output of this is only white-colored table.
I've also tried df.style.apply(colored_text) with the same result.
At that point I was lost, so I tried df.style.set_properties(color="green") instead of .apply(colored_text) and again, the output was the same white-colored table.
So now I'm not even sure if code in def colored_text(): is correct or not

print(df)that's always going to give you plaintext console output... If you want to see the display of a pandas styler you'll need to be in a dynamic HTML environment like Jupyter Notebook or Google Colab, or export to an environment which supports styling like Excel, LaTeX, or HTML.