cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

pandas .style is ugly in Databricks

DavidKxx
Contributor

Why does something like 

 

 

 

 

 

df.style.hide_index()

 

 

 

 

 

turn out so ugly in Databricks?  That command should show the dataframe pretty like always, but simply with the index column concealed.  Instead, here's an image of what happens instead (displaying the dataframe twice in this code -- first as regular, then with .style:
Screenshot 2024-03-11 111410.png

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz_Fatma
Community Manager
Community Manager

Hi @DavidKxxYou can use df.to_html(index=False) to generate an HTML representation of the DataFrame without the ...
Databricks notebooks have their own rendering and display mechanisms. Sometimes, the rendering of Pandas DataFrames within Databricks may not match what you expect due to differences in styling, CSS, or other factors.

View solution in original post

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @DavidKxxYou can use df.to_html(index=False) to generate an HTML representation of the DataFrame without the ...
Databricks notebooks have their own rendering and display mechanisms. Sometimes, the rendering of Pandas DataFrames within Databricks may not match what you expect due to differences in styling, CSS, or other factors.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group