<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 The datasets which are to be used in this screen.
Age-Group
First-time members
Occupation
Per State we represent
Party-Wise composition 
We use the same graphs as that in the PDF
Here onwards we start dealing with the data
use pandas DataFrames
Step1:  Style sheet for Matplotlib
Step2:  Sample Bar Plot
Step3:  Sample Pie Plot
Step4:  Average age of Men and Women
Step5:  Now we have read the data from the csv files
Step6:  Producing the same graph for women members
Step7:  Dealing with Occupational Backgrounds
<ASSISTANT_TASK:>
Python Code:
import os
os.chdir("/home/archimedeas/wrkspc/anaconda/major_1/datasets/1_the_senate_datasets")
import pandas as pd
import numpy as np
from bokeh._legacy_charts import output_notebook, show
import bokeh
df = pd.read_csv("1_age_group_5yr_span.csv", index_col = 0)
df
df.shape
Explanation: The datasets which are to be used in this screen.
Age-Group
First-time members
Occupation
Per State we represent
Party-Wise composition 
We use the same graphs as that in the PDF
Here onwards we start dealing with the data
use pandas DataFrames
End of explanation
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = (10.0, 8.0)
Explanation: Style sheet for Matplotlib
End of explanation
import numpy as np
import matplotlib.pyplot as plt
N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2)
ind = np.arange(N)  # the x locations for the groups
width = 0.35       # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(ind, menMeans, width, color = 'red', alpha = 0.6)
womenMeans = (25, 32, 34, 20, 25)
womenStd = (3, 5, 2, 3, 3)
rects2 = ax.bar(ind + width, womenMeans, width )
# add some text for labels, title and axes ticks
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind + width)
ax.set_xticklabels(('Frogs', 'Hogs', 'Bogs', 'Slogs', 'Kerebos'))
ax.legend((rects1[0], rects2[0]), ('Men', 'Women'))
plt.show()
Explanation: Sample Bar Plot
End of explanation
import matplotlib.pyplot as plt
import pandas as pd
# The slices will be ordered and plotted counter-clockwise.
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral']
explode = (0.1, 0.1, 0.1, 0.1) 
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
        autopct='%1.1f%%', shadow=True, startangle=90)
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
plt.show()
Explanation: Sample Pie Plot
End of explanation
df_men = pd.read_csv("1_age_group_5yr_span.csv")
Explanation: Average age of Men and Women
End of explanation
ls_labels_men = []
ls_values_men = []
for i in range(1,df_men.shape[0]):
    ls_labels_men.append(str(df_men.iat[i,0]))
    ls_values_men.append(float(df_men.iat[i,1]))
import numpy as np
import matplotlib.pyplot as plt
N = len(ls_labels_men)
ind = np.arange(N)  # the x locations for the groups
width = 0.35       # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(ind, ls_values_men, width, color = 'red', alpha = 0.6)
#rects2 = ax.bar(ind + width, ls_values_men, width )
# add some text for labels, title and axes ticks
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind + width)
ax.set_xticklabels(ls_labels_men)
#ax.legend((rects1[0], rects2[0]), ('Men', 'Women'))
plt.show()
Explanation: Now we have read the data from the csv files
End of explanation
df_women = pd.read_csv("8_women_age_group.csv")
ls_labels_women = []
ls_values_women = []
for i in range(1,df_women.shape[0]):
    ls_labels_women.append(str(df_women.iat[i,0]))
    ls_values_women.append(float(df_women.iat[i,1]))
import numpy as np
import matplotlib.pyplot as plt
N = len(ls_labels_women)
ind = np.arange(N)  # the x locations for the groups
width = 0.35       # the width of the bars
fig, ax = plt.subplots()
#rects1 = ax.bar(ind, ls_values_women, width, color = 'red', alpha = 0.6)
rects2 = ax.bar(ind + width, ls_values_women, width )
# add some text for labels, title and axes ticks
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind + width)
ax.set_xticklabels(ls_labels_women)
#ax.legend((rects1[0], rects2[0]), ('Men', 'Women'))
plt.show()
Explanation: Producing the same graph for women members
End of explanation
import pandas as pd
df_men = pd.read_csv("4_educational_background.csv")
df_men
ls_labels_men = []
ls_values_men = []
for i in range(1,df_men.shape[0]):
    ls_labels_men.append(str(df_men.iat[i,0]))
    ls_values_men.append(float(df_men.iat[i,1]))
len(ls_labels_men)
import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['figure.figsize'] = (10.0, 10.0)
# The slices will be ordered and plotted counter-clockwise.
labels = ls_labels_men
sizes = ls_values_men
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral', 'red', 'lightgreen']
#explode = (0.1, 0.1, 0.1, 0.1, 0, 0) 
p, text = plt.pie(sizes, labels=labels, colors = colors, shadow=True, startangle=90 )
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
#plt.title("Educational Background", fontsize = 50, loc = 'right')
plt.legend(p, labels, loc= 'lower right')
plt.show()
Explanation: Dealing with Occupational Backgrounds
End of explanation
<END_TASK>