-1

I am working with pandas DataFrames in python, so at the start of every notebook I typically load the module with

import pandas as pd

The layout of the DataFrames are very basic, and look something like this: enter image description here

However, I have seen other users with DataFrames that have a nicer layout, typically alternating the background colours between white and light-grey.

Does anyone know how I can set up this layout by default?

E. Earl
  • 134
  • 2
  • 13
ajb
  • 1
  • 1
    @bhaskarc not true; [styling](https://pandas.pydata.org/pandas-docs/stable/style.html) – roganjosh Sep 25 '18 at 17:09
  • @ajb , there is nothing wrong with the format you are using and its really a matter of style while you need nice display visuals. – Karn Kumar Sep 25 '18 at 17:21
  • @pygo but the point is there is actually a toolbox in Pandas specifically for what the OP is looking for. I linked it in my answer. – roganjosh Sep 25 '18 at 17:22
  • @roganjosh, that's correct, i'm agree to the point you mentioned, OP can look on that. – Karn Kumar Sep 25 '18 at 17:24
  • 1
    Possible duplicate of [Pandas style function to hignlight specific columns](https://stackoverflow.com/questions/41654949/pandas-style-function-to-hignlight-specific-columns) – n1tk Sep 25 '18 at 18:16
  • I think you are talking related to style, here is the info of the basis but will be helpful to see the style you "saw" so we can provide more details but the question has already an answer https://stackoverflow.com/questions/41654949/pandas-style-function-to-hignlight-specific-columns and you can provide the style format you build and if any issues on extending than you can ask with your code what is not possible to accomplish. – n1tk Sep 25 '18 at 18:18
  • 1
    @n1tk :/ I wish I'd seen that in my search or I would have flagged myself – roganjosh Sep 25 '18 at 19:06

1 Answers1

0

As there is no particular requirement in your question, I can only point you to the Styling documentation. This was introduced in 0.17 and probably isn't widely known about compared to other Pandas functionality.

roganjosh
  • 12,594
  • 4
  • 29
  • 46