<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Question 1
Step1:  Question 2
Step2:  Question 3
Step3:  Question 4
Step4:  Question 5
Step5:  Question 6
Step6:  Question 7. How many movies were made in the year 1950?
1033
Step7:  Question 8. How many movies were made from 1950 through 1959?
11999
Step8:  Question 9. In what years has a movie titled "Batman" been released?
2
Step9:  Question 10. How many roles were there in the movie "Inception"?
72
Step10:  WE GIVE UP
<ASSISTANT_TASK:>
Python Code:
dataframes['titles.csv'].count()
len(dataframes['titles.csv'].ix[:,0].unique())
Explanation: Question 1: How many movies are listed in the titles dataframe?
210591
Bonus
Unique movies == 192839
End of explanation
dataframes['titles.csv'].sort_values(['year']).iloc[0:2]
Explanation: Question 2: What are the earliest two films listed in the titles dataframe?
Miss Jerry (1894) && Reproduction of the Corbett and Fitzsimmons Fight (1897)
End of explanation
len(np.where(dataframes['titles.csv']['title'] == 'Hamlet')[0])
Explanation: Question 3: How many movies have the title "Hamlet"?
19
End of explanation
len(np.where(dataframes['titles.csv']['title'] == 'North by Northwest')[0])
Explanation: Question 4: How many movies are titled "North by Northwest"?
1
End of explanation
dataframes['titles.csv'].loc[(dataframes['titles.csv']['title']=='Hamlet'), 'year'].sort_values().iloc[0]
Explanation: Question 5: When was the first movie titled "Hamlet" made?
1910
End of explanation
dataframes['titles.csv'].loc[(dataframes['titles.csv']['title']=='Treasure Island'), 'year'].sort_values()
Explanation: Question 6: List all of the "Treasure Island" movies from earliest to most recent
1918
1920
1934
1950
1972
1973
1985
1999
End of explanation
dataframes['titles.csv'].loc[(dataframes['titles.csv']['year']==1950), 'year'].count()
Explanation: Question 7. How many movies were made in the year 1950?
1033
End of explanation
dataframes['titles.csv'].loc[(dataframes['titles.csv']['year']>=1950) & (dataframes['titles.csv']['year']<=1959), 'year'].count()
Explanation: Question 8. How many movies were made from 1950 through 1959?
11999
End of explanation
len(dataframes['titles.csv'].loc[(dataframes['titles.csv']['title']=='Batman'), 'year'].unique())
Explanation: Question 9. In what years has a movie titled "Batman" been released?
2
End of explanation
dataframes['cast.csv'].loc[(dataframes['cast.csv']['title']=='Inception'), 'character'].count()
Explanation: Question 10. How many roles were there in the movie "Inception"?
72
End of explanation
dataframes['titles.csv'].groupby('year')
#dataframes['titles.csv']['decade']= pd.Series(math.floor(dataframes['titles.csv']['year'].apply(int)/10.0)*10)
#math.floor(dataframes['titles.csv']['year'].apply(float))
    
Explanation: WE GIVE UP
End of explanation
<END_TASK>