zoukankan      html  css  js  c++  java
  • Kaggle_Data Visulazation of seaborn

    exercise1

    首先下载.csv文件的数据集,该数据集是基于如下背景:

    In this notebook, we'll work with a dataset of historical FIFA rankings for six countries: Argentina (ARG), Brazil (BRA), Spain (ESP), France (FRA), Germany (GER), and Italy (ITA). The dataset is stored as a CSV file (short for comma-separated values file. Opening the CSV file in Excel shows a row for each date, along with a column for each country.

    step1头文件导入

    import pandas as pd
    pd.plotting.register_matplotlib_converters()
    import matplotlib.pyplot as plt
    %matplotlib inline
    import seaborn as sns
    
    # Set up code checking
    import os
    if not os.path.exists("../input/fifa.csv"):
        os.symlink("../input/data-for-datavis/fifa.csv", "../input/fifa.csv")  
    from learntools.core import binder
    binder.bind(globals())
    from learntools.data_viz_to_coder.ex1 import *
    print("Setup Complete")

    验证数字正确性

    # Fill in the line below
    one = 1
    
    # Check your answer
    step_1.check()

    step2载入数据集

    # Path of the file to read
    fifa_filepath = "../input/fifa.csv"
    
    # Read the file into a variable fifa_data
    fifa_data = pd.read_csv(fifa_filepath, index_col="Date", parse_dates=True)
    
    # Check your answer
    step_2.check()

    其中无数次地检测 hint() and solution()

    step3 画数据图

    # Set the width and height of the figure
    plt.figure(figsize=(16,6))
    
    # Line chart showing how FIFA rankings evolved over time
    sns.lineplot(data=fifa_data)
    
    # Check your answer
    step_3.a.check()

    get the result

    kaggle上的例子,在博客均用于练习和后期为Data science做准备,请大家不要商业化。

  • 相关阅读:
    读《构建之法》有感
    作业3
    作业2
    个人简介
    闽江学院2015-2016学年下学期《软件测试》课程-第五次博客作业
    新手起航
    闽江学院2015-2016学年下学期《软件测试》课程-第二次作业(个人作业)3137102420 林恩典 软服1班 http://www.cnblogs.com/11443828qq
    个人简介
    构建之法心得体会
    第三次博客作业
  • 原文地址:https://www.cnblogs.com/yuyukun/p/12864795.html
Copyright © 2011-2022 走看看