[AstroPy] Table.pprint

Aldcroft, Thomas aldcroft at head.cfa.harvard.edu
Fri Feb 26 06:31:58 EST 2021


Indeed `tabl['col1', 'col99'].pprint()` is the right idiom for printing a
subset of columns. I see the docs didn't include anything quite like that,
so I added an example. See:
  https://github.com/astropy/astropy/pull/11354.

BTW, starting with the next release of astropy (4.3) you can persistently
include or exclude selected column names from being printed. This can be
helpful if you have a table that has some uninteresting columns, or perhaps
a very wide column that dominates printing. See:
  https://docs.astropy.org/en/latest/table/access_table.html#hiding-columns

- Tom


On Fri, Feb 26, 2021 at 4:45 AM Thomas Boch <thomas.boch at astro.unistra.fr>
wrote:

> Hi Rick,
>
> What about:
>
> tabl['col1', 'col99'].pprint()
>
> ?
>
> Cheers,
>
> Thomas
>
> Le 26/02/2021 à 09:54, Frederic V. Hessman a écrit :
> > Surely there's a simple way to pprint only selected columns of a table,
> something like
> >
> >>>> tabl.pprint (names=['col1','col99'])
> > but I haven't seen anything obvious.  Yes, there are brute force
> work-arounds, but....
> >
> > Rick
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at python.org
> > https://mail.python.org/mailman/listinfo/astropy
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20210226/3778215c/attachment.html>


More information about the AstroPy mailing list