LoginSignup
0
0

More than 3 years have passed since last update.

[kaggle]netfrix 掲載されたテレビ番組や映画を日米で比較してみた①

Posted at

はじめに

 kaggleで興味深いネタがあったので調べてみました。
 最近はテレビよりnetfrixなどの動画サービスを見ている人が増えていると言われています。好きなタイミングで好きな番組が見られるのは魅力ですよね。
 この動画サービスですが、国ごとにちょっと特色がありそうです。今回は探索的データ解析(EDA)を行い、その特色をつかんでみたいと思います。
 探索的データ解析そのものについてはこちらのサイトがより詳しいので興味がある方はご覧ください。

公式サイト

ライブラリのインポート

import numpy as np
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import japanize_matplotlib

CSVファイルの読み込み

kaggleのサイトよりダウンロードします。

data=pd.read_csv("netflix_titles.csv")
data.head()

国ごとに番組数を比較

data['country'].value_counts()

実行結果:

United States                                             2555
India                                                      923
United Kingdom                                             397
Japan                                                      226
South Korea                                                183
…                                                          

やはり米国が圧倒的ですが、日本も上位に入っているのはちょっとうれしいです。

番組の種類を確認

sns.countplot(x='type',data=data)

image.png

世界的な傾向として映画が多そうです。数からして米国のデータが強く反映されているのでしょう。

#数の確認
data['type'].value_counts()

実行結果:

Movie      5377
TV Show    2410
Name: type, dtype: int64

日本の分析

jp=data[data.country=='Japan']
jp

実行結果:

    show_id type    title   director    cast    country date_added  release_year    rating  duration    listed_in   description
24  s25 TV Show ​SAINT SEIYA: Knights of the Zodiac   NaN Bryson Baugus, Emily Neves, Blake Shepard, Pat...   Japan   January 23, 2020    2020    TV-14   2 Seasons   Anime Series, International TV Shows    Seiya and the Knights of the Zodiac rise again...
107 s108    Movie   37 Seconds  Hikari  Mei Kayama, Misuzu Kanno, Shunsuke Daitoh, Mak...   Japan   January 31, 2020    2020    TV-MA   116 min Dramas, International Movies    Trapped by society and familial obligations, a...
228 s229    Movie   A Silent Voice  Naoko Yamada    Miyu Irino, Saori Hayami, Aoi Yuki, Kensho Ono...   Japan   June 5, 2019    2016    TV-14   130 min Anime Features, International Movies    A former class bully reaches out to the deaf g...
253 s254    Movie   A Whisker Away  Junichi Sato, Tomotaka Shibayama    Mirai Shida, Natsuki Hanae, Hiroaki Ogi, Koich...   Japan   June 18, 2020   2020    TV-PG   104 min Anime Features, Children & Family Movies, Inte...   A peculiar girl transforms into a cat to catch...
260 s261    TV Show A.I.C.O.    Kazuya Murata   Haruka Shiraishi, Yusuke Kobayashi, Makoto Fur...   Japan   March 9, 2018   2018    TV-14   1 Season    Anime Series, International TV Shows    Everything Aiko knew was a lie. Now she's join...
... ... ... ... ... ... ... ... ... ... ... ... ...
7423    s7424   TV Show Violet Evergarden   NaN Yui Ishikawa, Takehito Koyasu, Daisuke Namikaw...   Japan   February 5, 2019    2018    TV-14   1 Season    Anime Series, International TV Shows, Romantic...   The war is over, and Violet Evergarden needs a...
7424    s7425   Movie   Violet Evergarden: Eternity and the Auto Memor...   Haruka Fujita   Yui Ishikawa, Minako Kotobuki, Aoi Yuki Japan   April 2, 2020   2019    TV-PG   91 min  Anime Features, International Movies, Sci-Fi &...   A lonely young woman feels trapped at her all ...
7740    s7741   TV Show Your lie in April   NaN Natsuki Hanae, Risa Taneda, Ayane Sakura, Ryot...   Japan   March 1, 2016   2014    TV-14   1 Season    Anime Series, International TV Shows, Romantic...   After his mother's death, a piano prodigy's wi...

分かりにくくて申し訳ないのですが、TV番号も意外と多いです。というかやはり日本はアニメが多そうです。グラフで比較してみます。

sns.countplot(x='type',data=jp)

image.png

米国との比較

もう少しカテゴリーを詳しく見てみます。

def JPUsa(x,y):
    plt.figure(figsize=(25,15))
    plt.subplot(211)
    usa_cat = x.groupby(['listed_in'])['show_id'].count().reset_index(name='count').sort_values(by='count',ascending=False)
    sns.barplot(x='listed_in',y='count',data=usa_cat.head(5),color='blue')
    plt.subplot(212)
    jp_cat = y.groupby(['listed_in'])['show_id'].count().reset_index(name='count').sort_values(by='count',ascending=False)
    sns.barplot(x='listed_in',y='count',data=jp_cat.head(5),color='blue')
    plt.show()

JPUsa(usa,jp)

実行結果:

image.png

上が米国で下が日本ですが、米国はドキュメンタリーやコメディーが中心に対して、日本はアニメが圧倒的でした。
何となく日本人が持つイメージと合致していそうです。

続く

日米の比較をもう少し続けつつ、年代などでももう少し探索を続けたいと思います。

 

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0