우당탕탕 개발공부
파이썬 데이터 분석 - 캐글 데이터 분석 ①-2 [ 넷플릭스 ] 본문
파이썬 데이터 분석 - 캐글 데이터 분석 ① [ 넷플릭스 ]
오늘은 캐글에 있는 '넷플릭스' 데이터를 이용해 간단한 분석 연습을 해 보았다. 🎈 링크 Netflix TV Shows and Movies Movies and TV Shows listings on Netflix (July, 2022) www.kaggle.com import pandas as pd import numpy as np im
rlory.tistory.com
지난 번에 이어서 이제는 데이터를 시각화하는 작업이다.
넷플릭스에 등록된 작품 중 어떤 타입이 가장 많을까?
nf_type = netflix['type'].value_counts().sort_values()
nf_type
plt.figure(figsize=(10, 7))
labels = ['TV Show', 'Movie']
plt.pie(nf_type, labels = labels, explode=[0.1, 0.1],
autopct='%1.2f%%',colors=['red','royalblue'], startangle=90)
plt.title('Type of Netflix Content')
plt.show()
Movie가 TV Show보다 약 5,000개 더 많이 등록이 되어 있다.
어느 나라에서 제작된 작품이 가장 많을까?
netflix['new_country'].value_counts().head(10)
pip install plotly_express
import plotly.express as px
nf_country_top10 = netflix['new_country'].value_counts().head(10)
fig = px.bar(nf_country_top10, y=nf_country_top10.index, x=nf_country_top10.values,
orientation = "h", color = nf_country_top10.index,text = nf_country_top10.values)
fig.update_traces( textfont_color = "white")
fig.update_layout( title = 'Number of works by country of production', font_size=20 ,
xaxis = dict ( title = "작품 수"), yaxis = dict ( title = "국가명"),
showlegend =False, template = 'plotly_white')
fig.show()
실행은 제대로 되는데... ..그래프가 보이지 않는다.... 왜그러는거니....
아시는 분들 댓글 남겨주세요....😥
미국(United State) 작품이 2130개로 가장 많이 등록되어 있는 걸 알 수 있다.
'✍ Study > 데이터 분석' 카테고리의 다른 글
파이썬 데이터 분석 - 데이터 분석 [ DACON 영화 관객 수 ② ] (0) | 2023.01.26 |
---|---|
파이썬 데이터 분석 - 데이터 분석 [ DACON 영화 관객 수 ①] (0) | 2023.01.26 |
파이썬 데이터 분석 - 캐글 데이터 분석 ① [ 넷플릭스 ] (0) | 2023.01.16 |
파이썬 데이터 분석 - [ 텍스트 마이닝 ] (0) | 2023.01.11 |
파이썬 데이터 분석 - [ 그래프 ] (0) | 2023.01.11 |