Professional Documents
Culture Documents
import pandas as pd
Out[2]:
show_id type title director cast country date_added release_year rating duration
Dick
Kirsten United September PG-
0 s1 Movie Johnson Is NaN 2020 90 min Docum
Johnson States 25, 2021 13
Dead
Ama
Qamata,
Inter
Khosi
TV Blood & South September TV- 2 TV Sh
1 s2 NaN Ngema, 2021
Show Water Africa 24, 2021 MA Seasons Dra
Gail
Mabalane,
Thaban...
Sami
Bouajila,
Tracy
TV Julien September TV- 1
2 s3 Ganglands Gotoas, NaN 2021 Inter
Show Leclercq 24, 2021 MA Season
Samuel TV Sh
Jouy,
Nabi...
Jailbirds
TV September TV- 1 Doc
3 s4 New NaN NaN NaN 2021
Show 24, 2021 MA Season
Orleans
Mayur
More,
Inter
Jitendra
TV Kota September TV- 2 TV
4 s5 NaN Kumar, India 2021
Show Factory 24, 2021 MA Seasons Rom
Ranjan
Show
Raj, Alam
K...
... ... ... ... ... ... ... ... ... ... ...
Mark
Ruffalo,
Jake Cult
David United November
David United November
8802 s8803 Movie Zodiac Gyllenhaal, 2007 R 158 min
show_id type title Fincher
director States date_added
cast country 20, 2019 release_year rating duration
Robert
Downey
J...
TV Zombie TV- 2 Ko
8803 s8804 NaN NaN NaN July 1, 2019 2018
Show Dumb Y7 Seasons Sh
Co
Jesse
Eisenberg,
Ruben Woody United November Co
8804 s8805 Movie Zombieland 2009 R 88 min
Fleischer Harrelson, States 1, 2019 Horror
Emma
Stone, ...
Tim Allen,
Courteney
Ch
Peter Cox, United January 11,
8805 s8806 Movie Zoom 2006 PG 88 min Family
Hewitt Chevy States 2020
Co
Chase,
Kate Ma...
Vicky
Kaushal,
Mozez Sarah- March 2, Inter
8806 s8807 Movie Zubaan India 2015 TV-14 111 min
Singh Jane Dias, 2019 Movie
Raaghav &M
Chanan...
# 2. Create a new column with assign that finds if a release_year is after 2020
df = df.assign(after_2020 = df['release_year'] > 2020)
df
Dick
As her father nears the end
0 s1 Movie Johnson Is ... Documentaries False
of his life, filmm...
Dead
This pawesome
Documentaries,
5972 s5973 Movie #cats_the_mewvie ... documentary explores False
International Movies
how our fel...
Horror Movies,
Truth and illusion blurs
996 s997 Movie HOMUNCULUS ... International Movies, True
when a homeless amnes...
Thrillers
release_year
count 8807.000000
mean 2014.180198
std 8.819312
... ...
50% 2017.000000
75% 2019.000000
max 2021.000000
8 rows × 1 columns
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 8807 entries, 0 to 8806
Data columns (total 13 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 show_id 8807 non-null object
1 type 8807 non-null object
2 title 8807 non-null object
3 director 6173 non-null object
4 cast 7982 non-null object
5 country 7976 non-null object
6 date_added 8797 non-null object
7 release_year 8807 non-null int64
8 rating 8803 non-null object
9 duration 8804 non-null object
10 listed_in 8807 non-null object
10 listed_in 8807 non-null object
11 description 8807 non-null object
12 after_2020 8807 non-null bool
dtypes: bool(1), int64(1), object(11)
memory usage: 834.4+ KB
# Alternative:
# Select the top 5 rows with df.head()
# Select the bottom 5 rows with df.tail()
Out[49]:
The
When the Nazis invade Poland,
1035 s1036 Movie Zookeeper's ... Dramas False
Warsaw Zoo caret...
Wife
5 rows × 13 columns
Out[50]:
Dick
As her father nears the end
0 s1 Movie Johnson Is ... Documentaries False
of his life, filmm...
Dead
Out[51]:
Dick Johnson Is
0 s1 Movie ... 90 min Documentaries False
Dead
8804 s8805 Movie Zombieland ... 88 min Comedies, Horror Movies False
8805 s8806 Movie Zoom ... 88 min Children & Family Movies, Comedies False
release_year
rating
66 min 2015
74 min 2017
84 min 2010
G 2004
NC-17 2014
NR 2015
PG 2012
PG-13 2011
R 2014
TV-14 2017
TV-G 2018
TV-MA 2018
TV-PG 2017
TV-Y 2018
TV-Y7 2017
TV-Y7-FV 2015
UR 2008
pivot = pivot.transpose()
pivot
Out[13]:
Out[13]:
release_year
rating
66 min 2015
74 min 2017
84 min 2010
G 2004
NC-17 2014
NR 2015
PG 2012
PG-13 2011
R 2014
TV-14 2017
TV-G 2018
TV-MA 2018
TV-PG 2017
TV-Y 2018
TV-Y7 2017
TV-Y7-FV 2015
UR 2008
id type title director cast country date_added release_year rating duration lis
Dick
Dick
id Movie
type title Kirsten
director United date_added
cast country September release_year PG-
0 s1 Johnson Is NaN 2020 rating duration lis
90 min Documen
Johnson States 25, 2021 13
Dead
Ama
Qamata,
Interna
Khosi
TV Blood & South September TV- 2 TV Show
1 s2 NaN Ngema, 2021
Show Water Africa 24, 2021 MA Seasons Dram
Gail
Mys
Mabalane,
Thaban...
Sami
Bouajila, Crim
Tracy
TV Julien September TV- 1
2 s3 Ganglands Gotoas, NaN 2021 Interna
Show Leclercq 24, 2021 MA Season
Samuel TV Show
Jouy,
Nabi...
Jailbirds
TV September TV- 1 Docus
3 s4 New NaN NaN NaN 2021
Show 24, 2021 MA Season Rea
Orleans
Mayur
More,
Interna
Jitendra
TV Kota September TV- 2 TV S
4 s5 NaN Kumar, India 2021
Show Factory 24, 2021 MA Seasons Roman
Ranjan
Shows
Raj, Alam
K...
... ... ... ... ... ... ... ... ... ... ...
Mark
Ruffalo,
Jake Cult M
David United November
8802 s8803 Movie Zodiac Gyllenhaal, 2007 R 158 min Dr
Fincher States 20, 2019
Robert Th
Downey
J...
Kid
TV Zombie TV- 2 Kore
8803 s8804 NaN NaN NaN July 1, 2019 2018
Show Dumb Y7 Seasons Show
Com
Jesse
Eisenberg,
Ruben Woody United November Com
8804 s8805 Movie Zombieland 2009 R 88 min
Fleischer Harrelson, States 1, 2019 Horror M
Emma
Stone, ...
Tim Allen,
Courteney
Child
Peter Cox, United January 11,
8805 s8806 Movie Zoom 2006 PG 88 min Family M
Hewitt Chevy States 2020
Com
Chase,
Kate Ma...
Vicky
Kaushal, Dr
Mozez Sarah- March 2, Interna
8806 s8807 Movie Zubaan India 2015 TV-14 111 min
Singh Jane Dias, 2019 Movies,
Raaghav & Mu
Chanan...