0

I am working a recommendations system with a movie datasets in which I have produced an output for several clients like this:

enter image description here

In which there are some duplicates. I want to print the texts with colors, so the same movie always appears in the same style and I can easily check which appear more than once. Is there any way to do it using pandas? Are there other libreries which I can use?

1 Answers1

0

You should take a look at the style property of dataframes. Official documentation: https://pandas.pydata.org/pandas-docs/version/1.1.5/user_guide/style.html.

Basically you have to create a function that maps your movie name to a style (set a background color for example) and then use df.style.applymap to apply this style.

Sergio Peñafiel
  • 446
  • 5
  • 13