예제 #1
0
 def getTopMoviesPublicRating(request):
     df = getData()
     topMovies = df.nlargest(15, ['PublicRating'])
     br = sns.barplot(y='MovieName', x='PublicRating', data=topMovies)
     br.set_yticklabels(br.get_yticklabels(), fontsize=7)
     mediapath = settings.MEDIA_ROOT
     figure = br.get_figure()
     figure.savefig(mediapath + "/chart1.png")
     return render(request, "dashboard/index.html",
                   {"PATH": settings.MEDIA_URL})
예제 #2
0
 def getTopMoviesGross(request):
     df = getData()
     topMovies = df.nlargest(15, ['GrossMillions'])
     gr = sns.barplot(y='MovieName', x='GrossMillions', data=topMovies)
     gr.set_yticklabels(gr.get_yticklabels(), fontsize=7)
     mediapath = settings.MEDIA_ROOT
     figure = gr.get_figure()
     figure.savefig(mediapath + "/chart1.png")
     plt.clf()
     return render(request, "dashboard/index.html",
                   {"PATH": settings.MEDIA_URL})
예제 #3
0
 def getCountMoviesYear(request):
     df = getData()
     df = df.loc[df['PublicRating'] > 0]
     df = df.loc[df['CriticRating'] > 0]
     gr = sns.countplot(y='Year', data=df)
     gr.set_yticklabels(gr.get_yticklabels(), fontsize=7)
     gr.set_title("Number of Movies that were rated by critics and public")
     mediapath = settings.MEDIA_ROOT
     figure = gr.get_figure()
     figure.savefig(mediapath + "/chart1.png")
     plt.clf()
     return render(request, "dashboard/index.html",
                   {"PATH": settings.MEDIA_URL})
예제 #4
0
 def getPublicRatingVsCriticRating(request):
     df = getData()
     data = df.loc[df['CriticRating'] > -1]
     data = data.loc[df['PublicRating'] > 0]
     gr = sns.jointplot(data=data, x='PublicRating', y='CriticRating')
     mediapath = settings.MEDIA_ROOT
     gr.savefig(mediapath + "/chart1.png")
     factlist = [1, 2, 3, 4, 5]
     plt.clf()
     return render(request, "dashboard/index.html", {
         "PATH": settings.MEDIA_URL,
         "factlist": factlist
     })
예제 #5
0
 def getRuntimevsGross(request):
     df = getData()
     data = df.loc[df.GrossMillions > 0]
     data = data.loc[data.PublicRating > 0]
     gr = sns.jointplot(data=data, x='PublicRating', y='Runtime')
     buf = io.BytesIO()
     mediapath = settings.MEDIA_ROOT
     gr.savefig(mediapath + "/chart1.png")
     plt.clf()
     factlist = [1, 2, 3, 4, 5]
     return render(request, "dashboard/index.html", {
         "PATH": settings.MEDIA_URL,
         "factlist": factlist
     })
예제 #6
0
 def getPublicRatingGenre(request):
     df = getData()
     df = df.groupby('Genre').mean()
     df = df.nlargest(10, 'PublicRating')
     return render(request, "dashboard/index.html",
                   {"PATH": settings.MEDIA_URL})