In [1]:
import pandas as pd
import os

In [2]:
os.getcwd()


Out[2]:
'C:\\Users\\acer\\Desktop\\Python for data science course by udemy'

In [3]:
movies = pd.read_csv("Movie-Ratings.csv")

In [4]:
len(movies)


Out[4]:
559

In [5]:
movies.head()


Out[5]:
Film Genre Rotten Tomatoes Ratings % Audience Ratings % Budget (million $) Year of release
0 (500) Days of Summer Comedy 87 81 8 2009
1 10,000 B.C. Adventure 9 44 105 2008
2 12 Rounds Action 30 52 20 2009
3 127 Hours Adventure 93 84 18 2010
4 17 Again Comedy 55 70 20 2009

In [6]:
movies.columns


Out[6]:
Index(['Film', 'Genre', 'Rotten Tomatoes Ratings %', 'Audience Ratings %',
       'Budget (million $)', 'Year of release'],
      dtype='object')

In [7]:
movies.columns=['Film', 'Genre', 'RottenRating', 'AudienceRating',\
                'BudgetMillion', 'Year']

In [8]:
movies.head()


Out[8]:
Film Genre RottenRating AudienceRating BudgetMillion Year
0 (500) Days of Summer Comedy 87 81 8 2009
1 10,000 B.C. Adventure 9 44 105 2008
2 12 Rounds Action 30 52 20 2009
3 127 Hours Adventure 93 84 18 2010
4 17 Again Comedy 55 70 20 2009

In [9]:
movies.info()


<class 'pandas.core.frame.DataFrame'>
RangeIndex: 559 entries, 0 to 558
Data columns (total 6 columns):
Film              559 non-null object
Genre             559 non-null object
RottenRating      559 non-null int64
AudienceRating    559 non-null int64
BudgetMillion     559 non-null int64
Year              559 non-null int64
dtypes: int64(4), object(2)
memory usage: 26.3+ KB

In [10]:
movies.describe()


Out[10]:
RottenRating AudienceRating BudgetMillion Year
count 559.000000 559.000000 559.000000 559.000000
mean 47.309481 58.744186 50.236136 2009.152057
std 26.413091 16.826887 48.731817 1.362632
min 0.000000 0.000000 0.000000 2007.000000
25% 25.000000 47.000000 20.000000 2008.000000
50% 46.000000 58.000000 35.000000 2009.000000
75% 70.000000 72.000000 65.000000 2010.000000
max 97.000000 96.000000 300.000000 2011.000000

In [ ]:


In [11]:
movies.Film =movies.Film.astype('category')

In [12]:
movies.head()


Out[12]:
Film Genre RottenRating AudienceRating BudgetMillion Year
0 (500) Days of Summer Comedy 87 81 8 2009
1 10,000 B.C. Adventure 9 44 105 2008
2 12 Rounds Action 30 52 20 2009
3 127 Hours Adventure 93 84 18 2010
4 17 Again Comedy 55 70 20 2009

In [13]:
movies.info()


<class 'pandas.core.frame.DataFrame'>
RangeIndex: 559 entries, 0 to 558
Data columns (total 6 columns):
Film              559 non-null category
Genre             559 non-null object
RottenRating      559 non-null int64
AudienceRating    559 non-null int64
BudgetMillion     559 non-null int64
Year              559 non-null int64
dtypes: category(1), int64(4), object(1)
memory usage: 47.4+ KB

In [14]:
movies.Genre =  movies.Genre.astype('category')
movies.Year  =  movies.Year.astype('category')

#movies.CriticRating  =  movies.CriticRating.astype('category')
#movies.AudienceRating =  movies.AudienceRating.astype('category')
#movies.BudgetMillion =  movies.BudgetMillion.astype('category')

In [15]:
movies.head()


Out[15]:
Film Genre RottenRating AudienceRating BudgetMillion Year
0 (500) Days of Summer Comedy 87 81 8 2009
1 10,000 B.C. Adventure 9 44 105 2008
2 12 Rounds Action 30 52 20 2009
3 127 Hours Adventure 93 84 18 2010
4 17 Again Comedy 55 70 20 2009

In [16]:
movies.info()


<class 'pandas.core.frame.DataFrame'>
RangeIndex: 559 entries, 0 to 558
Data columns (total 6 columns):
Film              559 non-null category
Genre             559 non-null category
RottenRating      559 non-null int64
AudienceRating    559 non-null int64
BudgetMillion     559 non-null int64
Year              559 non-null category
dtypes: category(3), int64(3)
memory usage: 40.3 KB

In [17]:
movies.Genre.cat.categories


Out[17]:
Index(['Action', 'Adventure', 'Comedy', 'Drama', 'Horror', 'Romance',
       'Thriller'],
      dtype='object')

In [18]:
# movies.Genre.unique()

In [19]:
movies.describe()


Out[19]:
RottenRating AudienceRating BudgetMillion
count 559.000000 559.000000 559.000000
mean 47.309481 58.744186 50.236136
std 26.413091 16.826887 48.731817
min 0.000000 0.000000 0.000000
25% 25.000000 47.000000 20.000000
50% 46.000000 58.000000 35.000000
75% 70.000000 72.000000 65.000000
max 97.000000 96.000000 300.000000


In [20]:
from matplotlib import pyplot as plt
import seaborn as sns

% matplotlib inline
import warnings
warnings.filterwarnings('ignore')

In [21]:
#Jointplots

In [22]:
movies.head()


Out[22]:
Film Genre RottenRating AudienceRating BudgetMillion Year
0 (500) Days of Summer Comedy 87 81 8 2009
1 10,000 B.C. Adventure 9 44 105 2008
2 12 Rounds Action 30 52 20 2009
3 127 Hours Adventure 93 84 18 2010
4 17 Again Comedy 55 70 20 2009

In [23]:
j = sns.jointplot( data=movies , x='RottenRating', y='AudienceRating')



In [24]:
j = sns.jointplot( data=movies , x='RottenRating', y='AudienceRating',kind='hex')



In [25]:
#<<< Chart1


In [26]:
#Histogram

In [27]:
m1 = sns.distplot(movies.AudienceRating, bins=15)



In [28]:
sns.set_style('darkgrid')
m2= sns.distplot(movies.RottenRating, bins=15)



In [29]:
sns.set_style('white')
n1 = plt.hist(movies.AudienceRating, bins=15,edgecolor = "black")



In [30]:
#<<< chart2

In [31]:
n2 = plt.hist(movies.RottenRating, bins=15,edgecolor = "black")



In [32]:
#<<< chart3


In [33]:
#stacked Histograms

In [34]:
h1= plt.hist(movies.BudgetMillion,edgecolor = "black")



In [35]:
plt.hist(movies.BudgetMillion,edgecolor = "black")
 plt.show()



In [36]:
movies[movies.Genre == 'Drama']


Out[36]:
Film Genre RottenRating AudienceRating BudgetMillion Year
10 88 Minutes Drama 5 51 30 2007
11 A Dangerous Method Drama 79 89 20 2011
13 A Serious Man Drama 89 64 7 2009
18 Albert Nobbs Drama 53 43 8 2011
23 All Good Things Drama 33 64 20 2010
26 An Education Drama 94 78 8 2009
27 Anonymous Drama 46 66 30 2011
47 Black Swan Drama 88 86 13 2010
53 Brothers Drama 61 62 26 2009
55 Buried Drama 86 63 2 2010
56 Burlesque Drama 36 66 55 2010
62 Changeling Drama 62 84 55 2008
74 Country Strong Drama 20 56 15 2010
84 Dear John Drama 29 66 25 2010
96 Dolphin Tale Drama 84 81 37 2011
99 Doubt Drama 78 75 25 2008
112 Eat Pray Love\t Drama 36 46 60 2010
116 Everybody's Fine Drama 46 55 21 2009
117 Everything Must Go Drama 74 53 5 2010
119 Extraordinary Measures\t Drama 27 55 31 2010
120 Extremely Loud and Incredibly Close Drama 47 62 40 2011
128 Fireproof Drama 40 51 1 2008
131 Footloose Drama 71 71 24 2011
132 For Colored Girls Drama 33 73 21 2010
151 Gran Torino Drama 80 90 33 2008
158 Hachiko: A Dog's Story Drama 58 85 16 2009
171 Hesher Drama 54 68 7 2010
195 Into the Wild Drama 82 90 15 2007
199 J.Edgar Drama 42 84 35 2011
213 Kit Kittredge: An American Girl Drama 78 26 10 2008
... ... ... ... ... ... ...
437 The Iron Lady Drama 53 54 13 2011
442 The Kite Runner Drama 66 85 20 2007
444 The Last Exorcism Drama 73 32 2 2010
445 The Last Song Drama 19 66 20 2010
446 The Lincoln Lawyer Drama 84 82 40 2011
450 The Lovely Bones Drama 32 57 65 2009
457 The Other Boleyn Girl Drama 41 65 40 2008
466 The Rum Diary Drama 50 48 45 2011
467 The Secret Life of Bees Drama 56 78 11 2008
470 The Soloist Drama 56 59 60 2009
480 The Time Traveler's Wife Drama 38 65 39 2009
482 The Tree Of Life Drama 84 61 32 2011
483 The Twilight Saga: Eclipse\t Drama 50 74 68 2010
484 The Twilight Saga: New Moon Drama 27 78 50 2009
487 The Uninvited Drama 31 52 0 2009
488 The Visitor Drama 92 83 4 2007
489 The Wolfman Drama 33 38 150 2010
490 The Women Drama 13 41 16 2008
492 There Will Be Blood Drama 91 84 25 2007
508 Tyler Perry's Meet the Browns Drama 31 36 20 2008
509 Tyler Perry's The Family That Preys Drama 51 36 10 2008
511 Under the Same Moon Drama 72 37 2 2007
516 Up in the Air Drama 90 76 25 2009
523 W. Drama 60 42 26 2008
527 Wall Street: Money Never Sleeps Drama 54 43 70 2010
529 War Horse Drama 77 73 66 2011
532 Water For Elephants Drama 60 72 38 2011
534 We Own the Night Drama 55 63 21 2007
541 Whip It Drama 84 73 15 2009
545 Winter's Bone Drama 94 73 2 2010

101 rows × 6 columns


In [37]:
movies[movies.Genre == 'Drama'].BudgetMillion


Out[37]:
10      30
11      20
13       7
18       8
23      20
26       8
27      30
47      13
53      26
55       2
56      55
62      55
74      15
84      25
96      37
99      25
112     60
116     21
117      5
119     31
120     40
128      1
131     24
132     21
151     33
158     16
171      7
195     15
199     35
213     10
      ... 
437     13
442     20
444      2
445     20
446     40
450     65
457     40
466     45
467     11
470     60
480     39
482     32
483     68
484     50
487      0
488      4
489    150
490     16
492     25
508     20
509     10
511      2
516     25
523     26
527     70
529     66
532     38
534     21
541     15
545      2
Name: BudgetMillion, Length: 101, dtype: int64

In [38]:
plt.hist(movies[movies.Genre == 'Action'].BudgetMillion,bins=15,edgecolor = "black")
 plt.hist(movies[movies.Genre == 'Drama'].BudgetMillion,bins=15,edgecolor = "brown")
 plt.hist(movies[movies.Genre == 'Thriller'].BudgetMillion,bins=15,edgecolor = "white")
 plt.show()



In [39]:
plt.hist([movies[movies.Genre == 'Action'].BudgetMillion,\
           movies[movies.Genre == 'Drama'].BudgetMillion,\
           movies[movies.Genre == 'Thriller'].BudgetMillion,\
           movies[movies.Genre == 'Comedy'].BudgetMillion],\
           bins=15,edgecolor='black',stacked=True)
 plt.show()



In [40]:
for gen in movies.Genre.cat.categories:
    print(gen)


Action
Adventure
Comedy
Drama
Horror
Romance
Thriller

In [41]:
list1=list()
for gen in movies.Genre.cat.categories:
   list1.append(movies[movies.Genre == gen ].BudgetMillion)
print(list1)


[2       20
5      200
15      35
29      20
30      20
33     237
36      45
39      45
40      70
45     150
49      68
52      17
58     140
60      85
63      40
66     125
67      25
69      40
70      90
73      30
76     163
77      13
81      25
83      20
86      45
94      30
98      33
101     75
102     30
106     45
      ... 
433    138
435     50
439     40
441     80
443    150
448     25
451     40
454    145
458    100
472    150
473      6
474      0
477    100
479     75
493    150
495     35
499    150
500    195
501    210
502     30
504    170
512     35
514     95
528     75
530     25
531    130
542     35
546    150
547    160
557     24
Name: BudgetMillion, Length: 154, dtype: int64, 1      105
3       18
19     200
21      45
24      40
32      78
46      20
65      38
68     140
130     73
165     12
166    125
167    250
168    150
176     36
178    150
192     70
193     60
241     60
272     37
341     19
363     70
386    130
401    155
459     59
463     25
506     38
540    100
548     60
Name: BudgetMillion, dtype: int64, 0       8
4      20
6      30
8      28
9       8
14     19
17     10
22     15
31     40
34     21
35     70
37     20
38     20
41     20
43     80
44      4
48     61
50     30
51     33
54     42
57     37
61     10
64      6
71     70
75     60
79      7
80      6
82     55
85     21
87      7
       ..
455    45
456    20
460    40
468    75
469    25
476    19
485    38
496    48
497    75
505    90
517    19
518    52
520    20
526    35
533    50
535    35
536    35
537    20
538    15
539     0
543    20
544    90
549    70
550    80
551    20
552    80
553    22
554    50
555    18
558    80
Name: BudgetMillion, Length: 172, dtype: int64, 10      30
11      20
13       7
18       8
23      20
26       8
27      30
47      13
53      26
55       2
56      55
62      55
74      15
84      25
96      37
99      25
112     60
116     21
117      5
119     31
120     40
128      1
131     24
132     21
151     33
158     16
171      7
195     15
199     35
213     10
      ... 
437     13
442     20
444      2
445     20
446     40
450     65
457     40
466     45
467     11
470     60
480     39
482     32
483     68
484     50
487      0
488      4
489    150
490     16
492     25
508     20
509     10
511      2
516     25
523     26
527     70
529     66
532     38
534     21
541     15
545      2
Name: BudgetMillion, Length: 101, dtype: int64, 7      32
12     35
20     40
28      5
59     26
88     10
97     25
100    30
103    50
109    20
126    40
135    19
137    30
160    20
161    15
175    10
194     2
246    35
259    25
285    20
286    30
292     1
293     3
294     5
311    18
315    12
321    42
322     4
332    10
333    11
335    40
343    25
349     8
355    13
373    50
404    20
414    12
416    40
426     5
429    15
453    18
461    40
462    37
464    16
465    25
475     9
478    38
486    16
521    10
Name: BudgetMillion, dtype: int64, 16      45
42      17
78      50
108     60
136     35
201      0
208     80
244     17
250     20
255     40
266     56
284     15
290     30
354     35
507    110
510     15
524      5
525      2
Name: BudgetMillion, dtype: int64, 25     100
72      60
95      20
105     15
179    150
180     60
189     40
225     27
237      4
243     25
253     20
261     20
263    130
267     70
282     85
358     32
385     51
389     20
394    110
406    185
407    100
408     20
419     90
424     48
432     13
471     15
481    100
491     35
494     21
498     22
503     35
513     30
515     35
519     75
522     40
556     65
Name: BudgetMillion, dtype: int64]

In [42]:
list1=list()
mylabels=list()
for gen in movies.Genre.cat.categories:
   list1.append(movies[movies.Genre == gen ].BudgetMillion)
   mylabels.append(gen)
h1=plt.hist(list1,bins=30,stacked=True,edgecolor="black",rwidth=2, label=mylabels)
plt.legend()
plt.show()



In [43]:
#<<<< chart4


In [44]:
#KDE plot

In [45]:
vis1 = sns.lmplot(data=movies , x='RottenRating', y='AudienceRating',fit_reg=False, hue='Genre',size=7,aspect=1)



In [46]:
k1= sns.kdeplot(movies.RottenRating, movies.AudienceRating,shade=True,shade_lowest=False,cmap='Reds')
#Tips:
#k1b= sns.kdeplot(movies.RottenRating, movies.AudienceRating,cmap='Reds')#KDE=KERNEL DENSITY ESTIMATION



In [47]:
k1= sns.kdeplot(movies.RottenRating, movies.AudienceRating,shade=True,shade_lowest=False,cmap='Reds')
#Tips:
k1b= sns.kdeplot(movies.RottenRating, movies.AudienceRating,cmap='Reds')




In [48]:
#working with subplots()

In [49]:
from matplotlib import pyplot as plt
import seaborn as sns

% matplotlib inline

In [50]:
k1=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating)



In [51]:
sns.set_style("dark")
k2=sns.kdeplot(movies.BudgetMillion, movies.RottenRating)



In [52]:
f,ax=plt.subplots(1,2)



In [53]:
f,ax=plt.subplots(1,3)



In [54]:
f,ax=plt.subplots(3,3)



In [55]:
f,ax=plt.subplots(3,2)



In [56]:
f,axes = plt.subplots(1,2,figsize=(12,6),sharex=True,sharey=True)
k1=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[0])
k2=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[1])
k1.set(xlim=(-20,160))


Out[56]:
[(-20, 160)]

In [57]:
axes


Out[57]:
array([<matplotlib.axes._subplots.AxesSubplot object at 0x000001CD96541908>,
       <matplotlib.axes._subplots.AxesSubplot object at 0x000001CD95178C50>], dtype=object)

In [58]:
f,axes = plt.subplots(2,2,figsize=(12,6))
k1=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[0,1])
k2=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[1,0])



In [59]:
f,axes = plt.subplots(2,2,figsize=(12,6))
k1=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[1,1])
k2=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[1,0])




In [60]:
#violinplots vs boxplots

In [61]:
w= sns.boxplot(data=movies,x='Genre', y='RottenRating')



In [62]:
w= sns.boxplot(data=movies[movies.Genre=="Drama"],x='Year', y='RottenRating')



In [63]:
z= sns.violinplot(data=movies,x='Genre', y='RottenRating')



In [64]:
z= sns.violinplot(data=movies[movies.Genre=='Drama'],x='Year', y='RottenRating')



In [65]:
#Creating a facet grid

In [66]:
g=sns.FacetGrid(movies,row='Genre', hue='Genre')



In [67]:
g=sns.FacetGrid(movies,row='Genre',col='Year',hue='Genre')



In [68]:
#g=g.map()
plt.scatter(movies.RottenRating,movies.AudienceRating)


Out[68]:
<matplotlib.collections.PathCollection at 0x1cd988d9400>

In [69]:
g=sns.FacetGrid(movies,row='Genre',col='Year',hue='Genre')
g=g.map(plt.scatter,'RottenRating','AudienceRating')



In [70]:
#CAN POPULATED WITH ANY TYPE OF CHART.example- Histograms

In [71]:
g=sns.FacetGrid(movies,row='Genre',col='Year',hue='Genre')
g=g.map(plt.hist,'BudgetMillion')



In [72]:
#back to the scatterplots:

In [73]:
g=sns.FacetGrid(movies,row='Genre',col='Year',hue='Genre')
kws=dict(s=50,linewidth=0.5,edgecolor='black')
g=g.map(plt.scatter,'RottenRating','AudienceRating',**kws)



In [74]:
kws


Out[74]:
{'edgecolor': 'black', 'linewidth': 0.5, 's': 50}

In [75]:
#Coordinate and diagonals:CONTROLING AXES AND ADDING DIAGONALS

In [76]:
g=sns.FacetGrid(movies,row='Genre',col='Year',hue='Genre')
kws=dict(s=50,linewidth=0.5,edgecolor='black')
g=g.map(plt.scatter,'RottenRating','AudienceRating',**kws)
g.set(xlim=(0,100),ylim=(0,100))
for ax in g.axes.flat:
    ax.plot((20,60),(20,60))



In [77]:
g=sns.FacetGrid(movies,row='Genre',col='Year',hue='Genre')
kws=dict(s=50,linewidth=0.5,edgecolor='black')
g=g.map(plt.scatter,'RottenRating','AudienceRating',**kws)
g.set(xlim=(0,100),ylim=(0,100))
for ax in g.axes.flat:
    ax.plot((0,100),(0,100),c='gray',ls='--')
g.add_legend()
plt.show()



In [78]:
#<<<< chart5



In [79]:
#Buildings dashboard in python

In [ ]:


In [86]:
from matplotlib import pyplot as plt
import seaborn as sns
% matplotlib inline

In [95]:
sns.set_style('darkgrid')
f, axes = plt.subplots(2,2,figsize=(15,15))
#1and 2
k1=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[0,0])
k2=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[0,1])
k1.set(xlim=(-20,160))
k2.set(xlim=(-20,160))
#3
z= sns.violinplot(data=movies[movies.Genre=='Drama'],x='Year', y='RottenRating',ax=axes[1,0])
#4
k3= sns.kdeplot(movies.RottenRating, movies.AudienceRating,shade=True,shade_lowest=False,cmap='Reds',\
               ax=axes[1,1])
#Tips:
k3b= sns.kdeplot(movies.RottenRating, movies.AudienceRating,cmap='Reds',ax=axes[1,1])
plt.show()



In [97]:
sns.set_style('darkgrid')
f, axes = plt.subplots(2,2,figsize=(15,15))
#1and 2
k1=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[0,0])
k2=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[0,1])
k1.set(xlim=(-20,160))
k2.set(xlim=(-20,160))
#3
z= sns.violinplot(data=movies[movies.Genre=='Drama'],x='Year', y='RottenRating',ax=axes[1,0])
#4
#k3= sns.kdeplot(movies.RottenRating, movies.AudienceRating,shade=True,shade_lowest=False,cmap='Reds',\
#              ax=axes[1,1])
#Tips:
#k3b= sns.kdeplot(movies.RottenRating, movies.AudienceRating,cmap='Reds',ax=axes[1,1])
axes[1,1].hist(movies.AudienceRating, bins=15,edgecolor = "black")
plt.show()



In [111]:
sns.set_style('dark',{"axes.facecolor":"black"})#white,whitegrid,dark,darkgrid,ticks
f, axes = plt.subplots(2,2,figsize=(15,15))
#plot[0,0]
k1=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[0,0],\
               shade=True,shade_lowest=True,cmap='inferno')
k1b=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[0,0],\
               cmap='cool')
#plot[0,1]
k2=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[0,1],\
              shade=True,shade_lowest=True,cmap='gist_rainbow')
k2b=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[0,1],\
               cmap='copper')
k1.set(xlim=(-20,160))
k2.set(xlim=(-20,160))
#plot[1,0]
z= sns.violinplot(data=movies[movies.Genre=='Drama'],x='Year', y='RottenRating',ax=axes[1,0])
#plot[1,1]
k3= sns.kdeplot(movies.RottenRating, movies.AudienceRating,shade=True,shade_lowest=False,cmap='Blues_r',\
               ax=axes[1,1])
#Tips:
k3b=  sns.kdeplot(movies.RottenRating, movies.AudienceRating,cmap='gist_gray_r',ax=axes[1,1])
plt.show()



In [119]:
sns.set_style('dark',{"axes.facecolor":"black"})#white,whitegrid,dark,darkgrid,ticks
f, axes = plt.subplots(2,2,figsize=(15,15))
#plot[0,0]
k1=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[0,0],\
               shade=True,shade_lowest=True,cmap='inferno')
k1b=sns.kdeplot(movies.BudgetMillion, movies.AudienceRating,ax=axes[0,0],\
               cmap='cool')
#plot[0,1]
k2=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[0,1],\
              shade=True,shade_lowest=True,cmap='inferno')
k2b=sns.kdeplot(movies.BudgetMillion, movies.RottenRating,ax=axes[0,1],\
               cmap='copper')
k1.set(xlim=(-20,160))
k2.set(xlim=(-20,160))
#plot[1,0]
z= sns.violinplot(data=movies,x='Year', y='BudgetMillion',ax=axes[1,0],pallete='YlOrRd')
#plot[1,1]
k3= sns.kdeplot(movies.RottenRating, movies.AudienceRating,shade=True,shade_lowest=False,cmap='Blues_r',\
               ax=axes[1,1])
#Tips:
k3b=  sns.kdeplot(movies.RottenRating, movies.AudienceRating,cmap='gist_gray_r',ax=axes[1,1])
plt.show()



In [120]:
#Thematics Edits

In [135]:
list1=list()
mylabels=list()
for gen in movies.Genre.cat.categories:
   list1.append(movies[movies.Genre == gen ].BudgetMillion)
   mylabels.append(gen)
sns.set_style('whitegrid')
fig,ax=plt.subplots()
fig.set_size_inches(11.7,8.27)#Size of A4
h1=plt.hist(list1,bins=30,stacked=True,edgecolor="black",rwidth=2, label=mylabels)
plt.title('Movie Budget Distribution',fontsize=35,color='DarkBlue',fontname='console')
plt.ylabel("Number of movies",fontsize=25,color='Red')
plt.xlabel("Budget",fontsize=25,color='Green')
plt.yticks(fontsize=20)
plt.xticks(fontsize=20)
plt.legend(frameon=True,fancybox=True,shadow=True,framealpha=1,prop={'size':20})
plt.show()



In [ ]: