Ejemplo n.º 1
0
    def show_onehundredthousand(self):
        onehundred_data = db.DB()

        view_list = onehundred_data.viewtotal_videonum_sql(100000, 1)
        view_list.sort()
        view_list.reverse()

        plt.title("NICONICO VIEW RANKING (view <= 100000)")
        plt.xlabel("rank")
        plt.ylabel("view")
        plt.plot(view_list)
        plt.show()
Ejemplo n.º 2
0
# coding:utf-8
import sqlite3
import analysis.db as db
import analysis.stats as stats
import analysis.graph as graph

if __name__ == "__main__":

    stats_data = stats.Statistics()
    stats_data.view_list()
    stats_data.comment_list()
    stats_data.mylist_list()

    ## 動画統計 ##
    db_data = db.DB()
    million = db_data.viewtotal_videonum_sql(1000000)
    print("1000000再生以上:" + str(million) + ", per:" +
          str(round(stats_data.percentage(million), 2)))
    onehundredthousand = db_data.viewtotal_videonum_sql(100000)
    print("100000再生以上:" + str(onehundredthousand) + ", per:" +
          str(round(stats_data.percentage(onehundredthousand), 2)))
    tenthousand = db_data.viewtotal_videonum_sql(10000)
    print("10000再生以上:" + str(tenthousand) + ", per:" +
          str(round(stats_data.percentage(tenthousand), 2)))
    thousand = db_data.viewtotal_videonum_sql(1000)
    print("1000再生以上:" + str(thousand) + ", per:" +
          str(round(stats_data.percentage(thousand), 2)))
    hundred = db_data.viewtotal_videonum_sql(100)
    print("100再生以上:" + str(hundred) + ", per:" +
          str(round(stats_data.percentage(hundred), 2)))
    print("動画総数:" + str(stats_data.num()))
Ejemplo n.º 3
0
import analysis.graph as graph
import analysis.output as out

if __name__ == "__main__":

    # タグごとの各中央値再生数のインスタンス保存
    median_list = list()

    ## タグ別のリストと動画総数のインスタンス生成 ##
    stats_anime = stats.Statistics()
    stats_anime.view_taglist("アニメ")
    stats_anime.comment_taglist("アニメ")
    stats_anime.mylist_taglist("アニメ")
    median = stats_anime.median()
    median_list.append(median[0])
    db_anime = db.DB()
    num_anime = db_anime.tag_videonum_sql("アニメ")
    # 平均値、中央値、標準偏差
    out.stats("アニメ", stats_anime, num_anime)

    stats_game = stats.Statistics()
    stats_game.view_taglist("ゲーム")
    stats_game.comment_taglist("ゲーム")
    stats_game.mylist_taglist("ゲーム")
    median = stats_game.median()
    median_list.append(median[0])
    db_game = db.DB()
    num_game = db_game.tag_videonum_sql("ゲーム")
    # 平均値、中央値、標準偏差
    out.stats("ゲーム", stats_game, num_game)
Ejemplo n.º 4
0
 def view_list(self):
     db_data = db.DB()
     self.view = db_data.all_viewlist_sql()
     #print(self.view)
     return self.view
Ejemplo n.º 5
0
 def num(self):
     db_data = db.DB()
     return db_data.all_videonum_sql()
Ejemplo n.º 6
0
 def mylist_taglist(self, tag):
     db_data = db.DB()
     self.mylist = db_data.tag_mylistlist_sql(tag)
     #print(self.mylist)
     return self.mylist
Ejemplo n.º 7
0
 def comment_taglist(self, tag):
     db_data = db.DB()
     self.comment = db_data.tag_commentlist_sql(tag)
     #print(self.comment)
     return self.comment
Ejemplo n.º 8
0
 def view_taglist(self, tag):
     db_data = db.DB()
     self.view = db_data.tag_viewlist_sql(tag)
     #print(self.view)
     return self.view
Ejemplo n.º 9
0
 def mylist_list(self):
     db_data = db.DB()
     self.mylist = db_data.all_mylistlist_sql()
     #print(self.mylist)
     return self.mylist
Ejemplo n.º 10
0
 def comment_list(self):
     db_data = db.DB()
     self.comment = db_data.all_commentlist_sql()
     #print(self.comment)
     return self.comment