본문 바로가기

Data Analysis/Kaggle

[Kaggle] Nexfilx movies and TV shows 데이터 분석 1 (데이터 확인 / 질문)

728x90

Nexfilx movies and TV shows 데이터셋 분석

분석 목적 : 넷플릭스 컨텐츠 분석으로 트렌드 파악

자료 출처 : https://www.kaggle.com/shivamb/netflix-shows

 

Netflix Movies and TV Shows

Listings of movies and tv shows on Netflix - Regularly Updated

www.kaggle.com


 1. 데이터 확인

# 기본 패키지 불러오기

import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use("seaborn") 
sns.set(font_scale = 1)
sns.set_style("whitegrid")

import plotly.express as px

import chart_studio.plotly as py
import cufflinks as cf
cf.go_offline(connected=True)

import plotly.graph_objects as go
import plotly.offline as pyo
pyo.init_notebook_mode()

from plotly.subplots import make_subplots

import missingno as msno

import warnings # 경고 메세지 숨기기
warnings.filterwarnings(action='ignore')

plt.rcParams['font.family'] = 'S-Core Dream' # 한글 폰트 가져오기 (WIN)
# plt.rc("font", family = "AppleGothic") # 한글 폰트 가져오기(MAC)
plt.rcParams['axes.unicode_minus'] = False # - 기호 깨짐 해결

 

# 데이터 불러오기

netflix = pd.read_csv("data/netflix_titles.csv")

print(netflix.shape)
netflix.head()

< 컬럼 설명 >
- show_id : id
- type : 분류 (TV or Movie)
- title : 제목
- director : 제작자
- cast : 출연진
- country : 제작국가
- date_added : Netflix 에 공개된 날짜
- release_year : 출시 연도
- rating : 관람 등급
- duration : 작품 길이
- listed_in : 해당 작품이 속한 분류
- description : 작품개요

 

 

# 데이터 정보 확인

netflix.info()

 

 

# 수치형 정보 확인

netflix.describe()

 

 

# 범주형 데이터 확인

netflix.describe(include = np.object_)

 

 

# 결측치 확인

netflix.isnull().sum()

 

 

# 결측치 시각화

msno.bar(netflix)

director 컬럼에 결측치가 많이 보이며 cast, country 컬럼에도 결측치가 다수 있습니다.

 

 

# 데이터 내용 간략히 정리

print("전체 데이터 수:", netflix.shape[0] * netflix.shape[1])
print("결측치 수: {} / 전체 데이터의 {:.2f}%".format(netflix.isnull().sum().sum(), (netflix.isnull().sum().sum()*100) / (netflix.shape[0] * netflix.shape[1])))
print("전체 작품 수:", netflix["title"].nunique())


2. 질문하기

1) 넷플릭스에 등록된 작품 중 어느 타입이 많을까?  
2) 어느 나라에서 제작된 작품이 가장 많을까?  
3) 넷플릭스에는 언제 등록된 작품이 많을까? (연/월)  
4) 관람 등급은 어떤 것이 가장 많을까?  
5) 작품 시간(길이)는 어느정도 되는 것이 가장 많을까?  
6) 어떤 장르가 가장 많을까?  

728x90