How do I output lists as a table in Jupyter notebook?

后端 未结 11 1250
灰色年华
灰色年华 2021-01-30 09:51

I know that I\'ve seen some example somewhere before but for the life of me I cannot find it when googling around.

I have some rows of data:

data = [[1,2         


        
11条回答
  •  感动是毒
    2021-01-30 10:50

    tabletext fit this well

    import tabletext
    
    data = [[1,2,30],
            [4,23125,6],
            [7,8,999],
            ]
    
    print tabletext.to_text(data)
    

    result:

    ┌───┬───────┬─────┐
    │ 1 │     2 │  30 │
    ├───┼───────┼─────┤
    │ 4 │ 23125 │   6 │
    ├───┼───────┼─────┤
    │ 7 │     8 │ 999 │
    └───┴───────┴─────┘
    

提交回复
热议问题