-2

I'd like to print a table of values, some of which are rational (a/b) and some just integers. Can tabulate do this? If so, how? If not, are there any other options?

user10831
  • 59
  • 1
  • 5
  • The problem I encountered was that tabulate converted my rationals to floats. I've gotten around that by converting each rational to a string. Not sure if there's a better way. – user10831 Oct 19 '15 at 04:06

1 Answers1

0

maybe you need https://docs.python.org/2/library/fractions.html you can rearrange your rationals with this package and then print them as you prefer, for example with tabular.

Helios83
  • 87
  • 1
  • 12