问题描述
代码:
from nba_api.stats.endpoints import commonteamroster
spurs = commonteamroster.CommonTeamRoster(team_id=1610612759).get_data_frames()
print(spurs)
结果:
[ TeamID SEASON LeagueID ... EXP SCHOOL PLAYER_ID
0 1610612759 2020 00 ... 2 Miami 1629022
1 1610612759 2020 00 ... 1 Kentucky 1629640
2 1610612759 2020 00 ... 3 Colorado 1628401
3 1610612759 2020 00 ... 3 Washington 1627749
4 1610612759 2020 00 ... 11 St.Mary's College of California 201988
5 1610612759 2020 00 ... 11 Southern California 201942
6 1610612759 2020 00 ... 14 Texas 200746
7 1610612759 2020 00 ... 2 Oregon State 1629234
8 1610612759 2020 00 ... 1 Mississippi State 1629683
9 1610612759 2020 00 ... 1 Union Olimpija 1629677
10 1610612759 2020 00 ... 14 Connecticut 200752
11 1610612759 2020 00 ... R Florida State 1630170
12 1610612759 2020 00 ... 4 Utah 1627751
13 1610612759 2020 00 ... 2 Ohio State 1628966
14 1610612759 2020 00 ... R Duke 1630200
15 1610612759 2020 00 ... 5 Kentucky 162
如何在每个类别之间不显示“...”的情况下显示所有数据?或者有什么方法可以让我将所述数据导出到 excel 中或将其可视化?
解决方法
pd.set_option('display.max_columns',None) pd.set_option('display.max_colwidth',None)