Pandas style doesn't work with Google colab

瘦欲@ 提交于 2020-06-27 10:22:27

问题


I'm facing a strange behavior with Google colab and pandas style. When applying a style to a dataframe on google colab, some of the basic styling is messed up: the table becomes smaller and more condensed, the highlight of every other row disappears, and the hover highlight of rows stops working.

I'm attaching a side-by-side picture of two screenshots: one from a regular Jupiter notebook, in which things are working fine, and another one from Google colab - in which styling messes up things.

The code is extremely simple:

df = pd.DataFrame(range(5)) # create a data frame

df                          # in a new cell - just show the dataframe

df.style.highlight_max()    # again, in a new cell. Works in Jupyter notebook, 
                            # doesn't work well on Google Colab. 

Any help would be appreciated.

来源:https://stackoverflow.com/questions/62255818/pandas-style-doesnt-work-with-google-colab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!