Add colour to a row depending on a certain value in python

I would like to add column to each row based on the number in the "Tree level" part, for example the row with Tree level = 0 will have a specific colour ect. Also if possible make the column width to adjust automatically.

the initial file is: initial file.

the final file should look like this for example: final file

i tried several code I can’t find the good ones.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum