我有以下内容df_teams_full_stats:Data columns (total 35 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Unnamed: 0 428 non-null int64 1 MatchID 428 non-null int64 2 For Team 428 non-null object 3 Against Team 428 non-null object 4 Date 428 non-null object 5 GameWeek 428 non-null int64 6 Home 428 non-null object 7 Possession 428 non-null float64 8 Touches 428 non-null int64 9 Passes 428 non-null int64 10 Tackles 428 non-null int64 11 Clearances 428 non-null int64 12 Corners 428 non-null int64 13 Offsides 428 non-null int64 14 Fouls Committed 428 non-null int64 15 Yellow Cards 428 non-null int64 16 Goals 428 non-null int64 17 XG 428 non-null float64 18 Shots On Target 428 non-null int64 19 Total Shots 428 non-null int64 20 Goals Conceded 428 non-null int64 21 Shots Conceded 428 non-null int64 22 XGC 428 non-null float64 23 Shots In Box 428 non-null int64 24 Close Shots 428 non-null int64 25 Headers 428 non-null int64 26 Shots Centre 428 non-null int64 27 Shots Left 428 non-null int64 28 Shots Right 428 non-null int64
1 回答
梦里花落0921
TA贡献1772条经验 获得超6个赞
如果您希望 x 和 y 轴是团队名称,您应该将 x 和 y 编码映射到包含团队名称的列。它可能看起来像这样(未经测试,因为您没有提供对数据的访问权限):
alt.Chart(df_teams_full_stats).mark_circle().encode(
x='For Team:N',
y='Against Team:N',
size='Goals:Q'
)
添加回答
举报
0/150
提交
取消