<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 What are the ten most common movie names of all time?
Step1:  Which three years of the 1930s saw the most films released?
Step2:  Plot the number of films that have been released each decade over the history of cinema.
Step3:  Plot the number of "Hamlet" films made each decade.
Step4:  Plot the number of "Rustler" characters in each decade of the history of film.
Step5:  Plot the number of "Hamlet" characters each decade.
Step6:  What are the 11 most common character names in movie history?
Step7:  Who are the 10 people most often credited as "Herself" in film history?
Step8:  Who are the 10 people most often credited as "Himself" in film history?
Step9:  Which actors or actresses appeared in the most movies in the year 1945?
Step10:  Which actors or actresses appeared in the most movies in the year 1985?
Step11:  Plot how many roles Mammootty has played in each year of his career.
Step12:  What are the 10 most frequent roles that start with the phrase "Patron in"?
Step13:  What are the 10 most frequent roles that start with the word "Science"?
Step14:  Plot the n-values of the roles that Judi Dench has played over her career.
Step15:  Plot the n-values of Cary Grant's roles through his career.
Step16:  Plot the n-value of the roles that Sidney Poitier has acted over the years.
Step17:  How many leading (n=1) roles were available to actors, and how many to actresses, in the 1950s?
Step18:  How many supporting (n=2) roles were available to actors, and how many to actresses, in the 1950s?
<ASSISTANT_TASK:>
Python Code:
titles.title.value_counts().head(10)
Explanation: What are the ten most common movie names of all time?
End of explanation
titles[(titles["year"]>=1930) & (titles["year"]<1940)].title.value_counts().head(3)
Explanation: Which three years of the 1930s saw the most films released?
End of explanation
t = titles
(t.year // 10 * 10).value_counts().sort_index().plot(kind='bar')
Explanation: Plot the number of films that have been released each decade over the history of cinema.
End of explanation
t = titles[titles.title == 'Hamlet']
(t.year // 10 * 10).value_counts().sort_index().plot(kind='bar')
Explanation: Plot the number of "Hamlet" films made each decade.
End of explanation
t = cast[cast.character == 'Rustler']
(t.year // 10 * 10).value_counts().sort_index().plot(kind='bar')
Explanation: Plot the number of "Rustler" characters in each decade of the history of film.
End of explanation
t = cast[cast.character == 'Hamlet']
(t.year // 10 * 10).value_counts().sort_index().plot(kind='bar')
Explanation: Plot the number of "Hamlet" characters each decade.
End of explanation
cast.character.value_counts().head(11)
Explanation: What are the 11 most common character names in movie history?
End of explanation
cast[cast.character == "Herself"].name.value_counts().head(10)
Explanation: Who are the 10 people most often credited as "Herself" in film history?
End of explanation
cast[cast.character == "Himself"].name.value_counts().head(10)
Explanation: Who are the 10 people most often credited as "Himself" in film history?
End of explanation
cast[cast.year == 1945].name.value_counts().head(1)
Explanation: Which actors or actresses appeared in the most movies in the year 1945?
End of explanation
cast[cast.year == 1985].name.value_counts().head(1)
Explanation: Which actors or actresses appeared in the most movies in the year 1985?
End of explanation
# (cast[cast.name == "Mammootty"].character // 1 * 1).value_counts().sort_index().plot(kind='bar')
cast[cast.name == 'Mammootty'].year.value_counts().sort_index().plot()
Explanation: Plot how many roles Mammootty has played in each year of his career.
End of explanation
cast[cast.character.str.startswith('Patron in')].character.value_counts().head(10)
Explanation: What are the 10 most frequent roles that start with the phrase "Patron in"?
End of explanation
cast[cast.character.str.startswith("Science")].character.head(10)
Explanation: What are the 10 most frequent roles that start with the word "Science"?
End of explanation
char = cast[cast.name == "Judi Dench"].sort("year")
char = char[char.n.notnull()]
char.plot(x="year",y ="n", kind="scatter")
Explanation: Plot the n-values of the roles that Judi Dench has played over her career.
End of explanation
char = cast[cast.name == "Cary Grant"].sort("year")
char = char[char.n.notnull()]
char.plot(x="year",y ="n", kind="scatter")
Explanation: Plot the n-values of Cary Grant's roles through his career.
End of explanation
char = cast[cast["name"]== "Sidney Poitier"]
char = char[char.n.notnull()]
char.plot(x="year",y="n",kind="scatter")
Explanation: Plot the n-value of the roles that Sidney Poitier has acted over the years.
End of explanation
c = cast
c = c[c.year // 10 == 195]
c = c[(c.n == 1) ]
c.type.value_counts()
Explanation: How many leading (n=1) roles were available to actors, and how many to actresses, in the 1950s?
End of explanation
c = cast
c = c[c.year // 10 == 195]
c = c[(c.n == 2) ]
c.type.value_counts()
Explanation: How many supporting (n=2) roles were available to actors, and how many to actresses, in the 1950s?
End of explanation
<END_TASK>