<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Data Exploration
Step1:  how many rows contain null values?
Step2:  Data Visualization
Let's compare ShareWomen and Unemployment_rate.
Step3:  Let's compare the share of men and women in engineering major.
Step4:  from the plot above, we found most students in engineering major are male.
Let's compare the number of men and women in engineering major.
<ASSISTANT_TASK:>
Python Code:
recent_grads = pd.read_csv('recent-grads.csv')
recent_grads.head()
recent_grads.tail()
recent_grads.describe()
recent_grads.shape
Explanation: Data Exploration
End of explanation
recent_grads.shape[0] - recent_grads.dropna().shape[0]
Explanation: how many rows contain null values?
End of explanation
from pandas.tools.plotting import scatter_matrix
scatter_matrix(recent_grads[['ShareWomen', 'Unemployment_rate']], figsize=(12,8))
plt.show()
sns.pairplot(recent_grads[['ShareWomen', 'Unemployment_rate']].dropna(), size=4)
sns.plt.show()
Explanation: Data Visualization
Let's compare ShareWomen and Unemployment_rate.
End of explanation
grads_eng_share = recent_grads[recent_grads['Major_category'] == 'Engineering']
grads_eng_share['ShareMen'] = 1 - grads_eng_share['ShareWomen']
grads_eng_share = grads_eng_share.set_index('Major')
grads_eng_share = grads_eng_share[['ShareMen', 'ShareWomen']]
grads_eng_share.head()
grads_eng_share.plot(kind='bar', figsize=(12,12))
plt.show()
Explanation: Let's compare the share of men and women in engineering major.
End of explanation
grads_eng_num = recent_grads[recent_grads['Major_category'] == 'Engineering']
grads_eng_num.head()
grads_eng_num = grads_eng_num.set_index('Major')
grads_eng_num = grads_eng_num[['Men', 'Women']]
grads_eng_num.head()
grads_eng_num.plot(kind='bar', stacked=True, figsize=(12,12))
plt.show()
Explanation: from the plot above, we found most students in engineering major are male.
Let's compare the number of men and women in engineering major.
End of explanation
<END_TASK>