Advertisement
Albinutte

Table pretty print

May 13th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. def pretty_print(a, row='row', col='col'):
  2.     """Pretty printing tables"""
  3.     n, m = a.shape
  4.     row_name = ['{}{}'.format(row, i + 1) for i in range(n)]
  5.     col_name = ['{}{}'.format(col, i + 1) for i in range(m)]
  6.     print(pd.DataFrame(a, row_name, col_name))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement