Printing Lists as Tabular Data

后端 未结 14 2498
小蘑菇
小蘑菇 2020-11-21 06:38

I am quite new to Python and I am now struggling with formatting my data nicely for printed output.

I have one list that is used for two headings, and a matrix that

14条回答
  •  南旧
    南旧 (楼主)
    2020-11-21 07:03

    >>> import pandas
    >>> pandas.DataFrame(data, teams_list, teams_list)
               Man Utd  Man City  T Hotspur
    Man Utd    1        2         1        
    Man City   0        1         0        
    T Hotspur  2        4         2        
    

提交回复
热议问题