Kaggle_Data Visulazation of line charts
时间:2020-05-11 21:31:14
收藏:0
阅读:63
step0 setup
set up pyhton libraries
import pandas as pd pd.plotting.register_matplotlib_converters() import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns print("Setup Complete")
set up code checking
# Set up code checking import os if not os.path.exists("../input/museum_visitors.csv"): os.symlink("../input/data-for-datavis/museum_visitors.csv", "../input/museum_visitors.csv") from learntools.core import binder binder.bind(globals()) from learntools.data_viz_to_coder.ex2 import * print("Setup Complete")
step1 load the data
# Path of the file to read spotify_filepath = "../input/spotify.csv" # Read the file into a variable spotify_data spotify_data = pd.read_csv(spotify_filepath, index_col="Date", parse_dates=True)
# Path of the file to read museum_filepath = "../input/museum_visitors.csv" # Fill in the line below to read the file into a variable museum_data museum_data = pd.read_csv(museum_filepath, index_col="Date", parse_dates=True) # Run the line below with no changes to check that you‘ve loaded the data correctly step_1.check()
step2 review the data
# Path of the file to readmuseum_filepath = "../input/museum_visitors.csv"
# Fill in the line below to read the file into a variable museum_datamuseum_data = pd.read_csv(museum_filepath, index_col="Date", parse_dates=True)
# Run the line below with no changes to check that you‘ve loaded the data correctlystep_1.check()
打印最后5行数据
原文:https://www.cnblogs.com/yuyukun/p/12866472.html
评论(0)