在jupyter实现数据的可视化

import pandas as pd

import numpy as np

import matplotlib

import matplotlib.pyplot as plt

%matplotlib inline

df=pd.read_csv('D:\MongoDB\猫眼电影前100排行.csv',encoding="gbk")   #读取数据
df.head(100) 

在jupyter实现数据的可视化_第1张图片

maoyan_key_factors = df[['title','score']]
maoyan_key_factors.head(100)

在jupyter实现数据的可视化_第2张图片

maoyan_score = maoyan_key_factors[['title', 'score']]
groupby_score = maoyan_score.groupby('score')
total_groupby_score = groupby_score.count()
print(total_groupby_score.rename(columns={'score':'Total'}))

在jupyter实现数据的可视化_第3张图片

c_score = total_groupby_score.plot(kind='bar')
c_score.set_title('Scoring statistics for the top 100 movie of cat eye movie')
c_score.set_ylabel('Count')

在jupyter实现数据的可视化_第4张图片

你可能感兴趣的:(在jupyter实现数据的可视化)