标签:size agg hot https port analysis alpha http plot
https://www.kaggle.com/dixhom/data-analysis-for-beginners/notebook
Kobe_Bryant_Shot_Selection.py
#这一段画图的代码不太理解
import matplotlib.cm as cm
plt.figure(figsize=(20,10))
def scatter_plot_by_category(feat):
alpha = 0.1
gs = nona.groupby(feat)
cs = cm.rainbow(np.linspace(0, 1, len(gs)))
for g, c in zip(gs, cs):
plt.scatter(g[1].loc_x, g[1].loc_y, color=c, alpha=alpha)
# shot_zone_area
plt.subplot(131)
scatter_plot_by_category(‘shot_zone_area‘)
plt.title(‘shot_zone_area‘)
# shot_zone_basic
plt.subplot(132)
scatter_plot_by_category(‘shot_zone_basic‘)
plt.title(‘shot_zone_basic‘)
# shot_zone_range
plt.subplot(133)
scatter_plot_by_category(‘shot_zone_range‘)
plt.title(‘shot_zone_range‘)
Kobe Bryant Shot Selection---不理解的代码
标签:size agg hot https port analysis alpha http plot
原文地址:https://www.cnblogs.com/wangzhonghan/p/10417116.html