I was trying to print this question: Groupby with User Defined Functions Pandas
My first attempt, using default settings from Safari, produced a column of text about 2 inches (5 cm) wide and truncated most of the code blocks. For example, this line
>>> people.groupby(lambda x: 'Group1' if people['b'].loc[x] > people['a'].loc[x] else 'Group2').sum()
printed as
>>> people.groupby(lambda x: 'Grou|
where the vertical bar represents about one pixel width of the p
.
Printing in landscaped worked better, but there was still about a 2 inch (5 cm) margin on the left and a 4 inch (10 cm) margin on the right. There was more output:
>>> people.groupby(lambda x: 'Group1' if people['b'].l
but it was still missing a significant portion of the line.
I looked for a print button, but I did not find anything that seemed relevant.
I eventually copied the text into a plain text document and then printed that. That did not truncate the text, but it did lose a lot of the formatting.