欢迎光临散文网 会员登陆 & 注册

唐宇迪Python Kaggle竞赛案例实战

2023-03-04 14:02 作者:塞纳河边一张饼  | 我要投稿
  • plt.title('Fare >distribution')
    plt.xlabel('Fare')
    plt.ylabel('Count of Passengers')
    #如果变量是categorical的,想看distribution,则可以:
    df.PdDistrict.value_counts().plot(kind='bar', figsize=(8,10))

  • 如果想看几个feature之间的联立情况,则可以用pandas的groupby,
    temp = pd.crosstab([df.Pclass, df.Sex], df.Survived.astype(bool))
    temp.plot(kind='bar', stacked=True, color=['red','bl


 

唐宇迪Python Kaggle竞赛案例实战的评论 (共 条)

分享到微博请遵守国家法律