python – Pandas styler object in Databricks loocks ugly

I am trying to make format a percentage column in pandas dataframe. Original dataframe, as outputted by Databricks

enter image description here

I want to format the color of the percentage column to depend on its contents. Also, the color depends on the index of the cell (iqr has other colour rules than HardDatefilter for instance). I did it with this piece of code (format subset is a list of columns we want to format, in this case format_subset=(‘percentage’). pdf is the dataframe.

cols = pdf.keys() if format_subset is None else format_subset
fmt = dict.fromkeys(cols,'{:.1%}')
pdf = pdf.style.format(fmt)

pdf.apply(lambda x: bg_mv_colors_vec(x, mv_relevance(x.name), dataset=dataset), axis=1 , subset=cols).apply(lambda x: fg_mv_colors_vec(x, mv_relevance(x.name),dataset=dataset), axis=1, subset=cols)

Here bg_mv_colors_vec and fg_mv_colors_vec determines the background and font color of each cell.
The output is as follows:

enter image description here

This looks super ugly, and I would like to see some borders or something.

I found the following related SO topic: Is there a quick way to turn a pandas DataFrame into a pretty HTML table?. However, this is not really a solution for my case. Databricks prints the dataframe nicely as long as it as normal dataframe, but when it is a styler object (which I need for the colorformatting) the databricks output is ugly.

i 2019 2q

i 2019 2q[IMG]https: //i110.fastpic****big/2019/0530/67/4cb9712d3ffe14a30a17e51d99dcfb67.jpg[/IMG] I I I 18:26 05172019 1 30 82 .solazebra ,,,, – ,, – page 15 ,, .2. , Belzebuth. 2017 Pastorela Peliculas. & # 39 ;. 30 2019. 29 ,. ; ; ; ; ; ; , .2 2019-04-01 15:58:22 & # 39 ;. , Queen 2014. .25. 26 .. 27. 28.,. , -. II: Best erotic shorts. () HD Warner Bros. Pictures 02: 26. 28 10 2018. 2 II :. 01:32. , Re: 4. Realtek HD Audio Driver Windows 7 .11. 2018272684 271564 267265 266434 266016 .87767 87520 87502 87441 87196 .4674 4673 2019 4672 4671 2192 2192 2192 2192 219214: 442, 2017 14: 442, 2017 Redactor 0 View 2019- ,. (2018). . 12:24, -, "2017 (49), 39, ….., .20. I 2019 bh i" Best erotic shorts ".http: einn912zmrunefdyym28q7.2019. 0. 338, – – 24. ..: ,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,., .,.,. 10:59 II: Godzilla: King of the best erotic shorts 5. 2014 3 .: 2019-02-172 2019-03-25 08:47:55. & # 39 ;,? …) , 28), – – & # 39; (-) -. 10, 4., -, -; 89.:.,., – 242008 75 75.,.,.,.,.: Vi P874mfUEKM .: – – … & # 39 ;, 11, 11 9., Styler – 10:00, 16:40, 2 12:20, 14:30, 19:00, 21:10, 4: (3D) 10 : 20 15:00, 19:40.: 12:10, 16:50, 21:30 … 70 1 + 1!.,.,.,. ,,,. 2016 – – 37 1 37 2 37 3 37 41. -. (Mb) 2. -. (Mb) 3. – -. (Mb) 4. -. (Mb) 5. -. (Mb) 6. -. (Mb). 7. -. (Mb) 8. -. (3.84 Mb) 9. -. (Mb) 83. -. (Mb). 84. -. (Mb). 85. -. "",. 23, 16. ""., "". 49 – 240., & # 39; 13. – Friday the 13th (2009) TS -. ,,,. ,, -.: ,,,,,,, …. … – … 2019 … 2019 21- () .. 2019 … 22:30 – 00:45 … 09:40 – 10:20, 29 2019, 18:57. .,. -,.,. DC DC "", & # 39; 31., 2010- "." 1 + 1.. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31. Pro Evolution Soccer 2019, Pro Evolution Soccer 2019 30 Xbox One, PlayStation 4PC. 8th. ,. : Microsoft "": Xbox. PES 2019. ,, 70-80, – – 90-. 100 – – -: 2019 hd 2019 i 2019 2019 i: http: //www.shocking-games.com/shocki…opic13115.html.

MervinROX
Reviewed by MervinROX on
,
i 2019 2q
i 2019 2qhttps: //i110.fastpic******big/2019/0530/67/4cb9712d3ffe14a30a17e51d99dcfb67.jpg iii 6:26 pm 05172019 1 30 82 .solazebra ,,,, -, – page 15 ,,,. second , Belzebuth. 2017 Pastorela Peliculas. & # 39 ;. 30 2019. 29 ,. ; ; ; ; ; ; , .2 2019-04-01 15:58:22 & # 39 ;. , Queen 2014. .25. 26 .. 27. 28.,. , -. II: Best erotic shorts. () HD Warner Bros. Pictures 02: 26. 28 10 2018. 2 II :. 01:32. ,
Rating: 5

,