# Printing PyRanges

There are 10 helper methods for printing PyRanges. These are p/print (regular print),
mp (merged position print), sp (sorted print), msp (merged position sorted
print) and rp (raw print).

Merged means that the information about Chromosome, Start, End and Strand (if
applicable) are merged into one column for printing. Sorted means that the
output is sorted on position and Strand. Regular print shows the + strand first
and - strand second, so if you want to display interleaved intervals from both
strands, sorted print is the way to do it.

Raw print (rp) just prints the underlying dict of dataframes.

All print methods except rp take an n-argument to control how many entries should be displayed.

The pc, mpc, spc, mspc and rpc also return the pyranges so that print methods
can be used to display intermediate results in pipes.

```{python tidy=FALSE}
import pyranges as pr

exons = pr.data.exons()
exons.pc(n=2).mpc(n=8).sp()

exons.print(n=1,
            merge_position=False,
            sort=True,
            formatting={"Start": "{:,}", "Name": "{:2.2}"},
            chain=False)
```

```{python tidy=FALSE}
f1 = pr.data.f1()
f1.rp()
```