Dun Peal Dun Peal - 1 year ago 281
Python Question

Is there a way to (pretty) print the entire Pandas Series / DataFrame?

I work with Series and DataFrames on the terminal a lot. The default

for a Series returns a reducted sample, with some head and tail values, but the rest missing.

Is there a builtin way to pretty-print the entire Series / DataFrame? Ideally, it would support proper alignment, perhaps borders between columns, and maybe even color-coding for the different columns.

Answer Source

Sure, if this comes up a lot, make a function like this one. You can even configure it to load every time you start IPython: http://ipython.org/ipython-doc/dev/config/overview.html

def print_full(x):
    pd.set_option('display.max_rows', len(x))

As for coloring, getting too elaborate with colors sounds counterproductive to me, but I agree something like bootstrap's .table-striped would be nice. You could always create an issue to suggest this feature.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download