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)
maoyan_key_factors = df[['title','score']]
maoyan_key_factors.head(100)
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'}))
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')