cancel
Showing results for 
Search instead for 
Did you mean: 
Community 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
New Contributor III

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.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!