0% found this document useful (0 votes)
39 views10 pages

Amazon Prime Analysis

Uploaded by

deepak Rulez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
39 views10 pages

Amazon Prime Analysis

Uploaded by

deepak Rulez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 10
1817723, 1017 AM In [1]: In [2]: In [3]: Unttled22-Copy' ~Jpyier Notebook Amazon Prime Videos Analysis Using Python ‘The Amazon Prime Videos set has the information about the Tv Shows & Movies. The Data set available from Flexible which is a Third Party Amazon Prime Videos which engine . and available on Kaggle dataset for free. Import Library import pandas as pd import pandas as pd import seaborn as. sns inport matplotlib.pyplot as plt import seaborn as sns €:\Users\Syed Arif\anaconda3\1ib\site-packages\scipy\__init_.py:146: Userwar ning: A NumPy version >=1.16.5 and <1.23.@ is required for this version of Sc ipy (detected version 1.25.1 warnings.warn(f"A NumPy version >=(np_minversion} and <{np_maxversion}" Uploading Csv fle dF = pd.read_csv(r"C:\Users\syed Arif\Downloads\amazon_prime_titles.csv") Data Preprocessing -head() head is used show to the By default rows in the dataset localhost 8888/notebooks/Untiled22-Copy1 pynbtin-which-yoar-neighest-aling-show-ir-line-plot sno 1817723, 1017 AM In [4]: df.head() Unttled22-Copy' ~Jpyier Notebook out(a]: show.ld type ttle director __cast_country date_added release_yoar rating Brendan the Gleeson, Don Tayor March 2, © at Move rnd yggSQh AT cmada Mae 2014 NaN Cordon Prsent Mahesh Take Maniekar, se Novo Gute Gish ADhay gig Maren 30, . 1 2 Mi Good Joshi Mahajan, Ind 2021 201813 Night Sachin wenedokar Tor Sizemore torenzo Secrets of dosh United Maren 0, 268 Mowe Camas 2017 NaN Deception weber EAMES: Sates B02 LaSerdo ® Interviews Pink wih in sonia United Mare 3, 2st Movo Staying Adol 7 2014 NaN 0 ppderson yall States 202 rinoy. tomy Dean stanton Monster _Gies United Maren 30, 4 55 Movio Mater Foster M8" cngdom 2021 ‘000 Non George Cos. -tail() tail is used to show rows by Descending order cans 88otbocktUrile22-opy ipl whchyearnighas ang how 210 1817723, 1017 AM Unttled22-Copy' ~Jpyier Notebook In 5]: df.tail() out(5]: show id type _ ttle director cast country date_added release_year atin Pride Of Joseph Leo Goroey 9662 39664 Move The Ht Bobby NaN Nan 1407 Bowery Lewis Jordan oick vosauRGH TV Planet RONNIE assa 59605 g,7V Planet a STEVENS, NaN NaN awe 6 Liay MORRIS, i Ray Stevenson, Stove ‘an 9665 39665 Move Oulpost St lan ay NaN 2008 Richard Brake, M Esteban Maradona Recagno, ees 30067 g,/¥ “Blessed NaN "Ezoaulel NaN NaN oer Dream Stemi Luciano Vit Michaol Caine, Emily 9667 59668 Movie —_fHamty Daniel Nicrimer, NaN NaN 2010 Joseph Gigun, , -Shape It show the total no of rows & Column in the dataset In [6]: df.shape out[6]: (9668, 12) -Columns It show the no of each Column localhost 88¢8natabooks!Urtilad22-Copy1ipmbinwhich-yer-eghestating shows ano 1817723, 1017 AM In [7]: out(7]: In [8]: out [8]: In [9]: out [9]: localhost 8888/notebooks/Untiled22-Copy1 ipynbfin-which-yoar-neighest-aling-shows Untted22-opyt super Notebook df.columns Index({"show_id', ‘type’, ‘title’, ‘director’, ‘cast’, ‘country’, “date_adde w snetease year’, ‘rating’, ‘duration’, “Listed in’, ‘description’ ], atype=" object) -dtypes This Attribute show the data type of each column df.dtypes show_id object type object title object director object cast object country object date_added object release year int64 rating object duration object Listed_in object description object dtype: object -unique() ina column, It show the unique value of specific column dF["director"] unique) array(['Don McKellar’, ‘Girish Joshi’, ‘Josh Webber’, “John-Paul Davidson, Stephen Warbeck’, ‘Emily Skye’, ‘Steve Barker'], dtype=object) -nuique() It will show the total no of unque value from whole data frame ano 1817723, 1017 AM In [10]: df.nunique() out[10]: show_id 9668 type 2 title 9668 director s774 cast 7927 country 86 date_added 84 release year 100 rating 24 duration 29 Listed_in sis description 9414 type: intes -describe() Unttled22-Copy' ~Jpyier Notebook It show the Count, mean , median ete In [11]: df.describe() out[11]: release_year ‘count std 25% 50% 75% -value_counts '9668.000000 2008,341849 19.922402 +1920,000000 2007.000000 2016,000000 2019,000000 2021.000000 It Shows all the unique values with their count localhost 8888/notebooks/Untiled22-Copy1 ipynbfin-which-yoar-neighest-aling-shows so 1817723, 1017 AM In [12]: out (12): In [13]: out [13]: Unttled22-Copy' ~Jpyier Notebook df["director"].value_counts() Mark Knight 113 Cannis Holder 61 Moonbug Entertainment 37 Jay Chapman 3a Arthur van Merwijk 30 Andrew Traucki 1 Karyn Kusama 1 K. Subash 1 Robert Cuffley 1 steve Barker 1 Name: director, Length: 5774, dtype: inte4 isnull() It shows the how many null values df isnull() show_id type title director cast country date_added release year rating duration 0 False False False False False False False False Tue False 1 False False False False False False False False False False 2 False False False False False False False False Tue False 3 False False False False False False False False Tue False 4 False False False False False False False False Tue False 9663 False False False False Fake True True False False False 9664 False False False Tue False Tue True False False False 9665 False False False False Fake © Tue Tre False False False 9666 False False Falso © Tue False © Tue True False False False 9667 False False False False Fake Tre Tre False False False 9668 rows x 12 columns localhost 8888/notebooks/Untiled22-Copy1 pynbtin-which-yoar-neighest-aling-show-ir-line-plot ano 1817723, 1017 AM Unttled22-Copy' ~Jpyier Notebook In [14]: df.info() Rangelndex: 9668 entries, @ to 9667 Data columns (total 12 columns # Column Non-Null Count type e 9668 non-null. 1 9668 non-null. 2 9668 non-null 3 director 7586 non-null. 4 cast 8435 non-null 5 country 672 non-null 6 date_added 155 non-null 7 release_year 9668 non-null 8 rating 9331 non-null. 9 duration 9668 non-null 1@ listed_in 9668 non-null 11 description 9668 non-null intea(1), object(11) memory usage: 906.5+ KB How many Null value present show all the null values in Heatmap. In [15]: sns.heatmap(dF. isnul1()) plt.show() uration escription In which year Heighest number of Tv shows and Movies were release. localhost 8888/notebooks/Untiled22-Copy1 pynbtin-which-yoar-neighest-aling-show-in-line-plot 1817723, 1017 AM In [16]: out(16]: In [17]: out [17]: In [18]: out (18): Unitled22-Copy' -Jupyter Notebook df[‘release_year' ].value_counts() 2e21 1442. 2020 © 962 2019 929 2018 © 623 2017562. 1922 2 1926 2 1924 1 1923 1 1927 1 Name: release_year, Length: 108, dtype: intea How many Movies and Tv shows are in the dataset df -type.value_counts() Movie 7814 TV Show 1854 Name: type, dtype: int64 df -type.value_counts().plot(kind = "bar") 2000 7000 «000 000 4000 3000 2000 . Zz ; Movie show Show all records Type is "Movies" & Country is "United Kingdom". localhost 8888inotebooks/Untiled22-Copy1pynbin-vhich-year-neigheslaling-show-in-line-plot ano 1817723, 1017 AM Unttled22-Copy' -Jupyier Notebook In [19]: df[(d#["type"] = jovie") & (df["country"] ‘United Kingdom")].head(3) out([19): show.id type tile rector _cast_county_date_added_rlease_year rating ary Deen Monster Giles “Kfort _Unted March 30, 4 85 Movie Maker Foster O'Brien, Kingdom 2021 1989 NaN Geom eos Gregory hing chsh per i Uied Mare 30 5 86 Move Wi wand Stevenson, Kings Sop 1968 NN on vate on Eon Musk, Musk Winer United 1496 Nove Teen! tla Wenner Une! ay2.aer 2018 Ha Weston ron odor, saterbra Show all records Type is “Movies” & director is “Paul Weiland". In [23]: dF{(dF["type"] == "Movie") & (df["director"] == "Paul Weiland")]-head(3) out {23}: show_ld type thie. director cast country date_added release year rating dk eregory 5 Beng pay et United — Marc o, 58 Movie Mt Wieland. Stevenson, Kingdom 2024 1969 NaN hone Show Top 3 Directors, Who gave the heighest Number of Tv shows and Movies Released on Prime Video. In [27]: df["director*].value_counts()-head(3) out{27]: Mark knight 13 Cannis Holder 62 Moonbug Entertainment 37 inted Name: director, dtype: localhost 8888/notebooks/Untiled22-Copy1 pynbtin-which-yoar-neighest-aling-show-in-line-plot sno 1817723, 1017 AM LUnitled22-Copy' -Jupyter Notebook in which year heighest rating show in a plot In [33]: sns.stripplot(x = “release year" , y = ‘rating’, data = df) out[33]: rating 32019801960 «1980 «2000-2020 release year In (]: localhost 8888inotebooks/Untiled22-Copy1pynbin-vhich-year-neigheslaling-show-in-line-plot r010

You might also like