text_plain_output_2.png text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

reviews = pd.read_csv('../input/ml-1m/ml-1m/ratings.dat', names=['userID', 'movieID', 'rating', 'time'], delimiter='::', engine='python')

rts_gp = reviews.groupby(by=['rating']).agg({'userID': 'count'}).reset_index()
rts_gp.columns = ['Rating', 'Count']

plt.barh(rts_gp.Rating, rts_gp.Count, color='royalblue')
plt.title('Overall Count of Ratings', fontsize=15)
plt.xlabel('Count', fontsize=15)
plt.ylabel('Rating', fontsize=15)
plt.grid(ls='dotted')
plt.show()