<jupyter_start><jupyter_text>How do boys and girls performs across states?<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
col = pd.read_csv("dataset/nas/nas-columns.csv")
col.head()
label = pd.read_csv('dataset/nas/nas-labels.csv')
label
data = pd.read_csv("dataset/nas/nas-pupil-marks.csv")
data.head()<jupyter_output><empty_output><jupyter_text>Select needed variable<jupyter_code>df = data[['State','Gender',]]
subject = data[['Maths %', 'Reading %', 'Science %', 'Social %']]
subject.head(10)
subject['Maths %'].fillna(subject['Maths %'].mean(), inplace=True)
subject['Reading %'].fillna(subject['Reading %'].mean(), inplace=True)
subject['Science %'].fillna(subject['Science %'].mean(), inplace=True)
subject['Social %'].fillna(subject['Social %'].mean(), inplace=True)

subject.head()
subject.max()<jupyter_output><empty_output><jupyter_text>Create target variable<jupyter_code>subject['Percent'] =((subject['Maths %'] + subject['Reading %'] + subject['Science %'] + subject['Social %'])/400) * 100
subject.head(20)
Percent  = subject[['Percent']]
data_frame = pd.concat([df,Percent],axis=1)
data_frame.head(20)
data_frame['Gender'].replace([1,2],['Boy','Girl'],inplace=True)
data_frame.head()
data_frame.groupby('Gender')['Percent'].describe()
data_frame['Gender'].value_counts(dropna=False)
# remove all row which contain gender as a 0
data_frame2 = data_frame[data2['Gender'] != 0]
data_frame2.groupby('Gender')['Percent'].describe()
data_frame2.head(20)
df2 = pd.DataFrame(final.groupby(['State','Gender'])['Percent'].sum())
df2.head()
df2.to_csv('asd')
data_frame3 = pd.read_csv('asd')
data_frame3.head(20)
#final.groupby(['State','Gender'])['Percent'].count()
s = pd.DataFrame(final.groupby(['State','Gender'])['Percent'].count())
s.head()
s.to_csv('count.csv')
count=pd.read_csv('count.csv')
count.rename(columns={'Percent': 'Count'}, inplace=True)
cnt = count[['Count']]
cnt.head()
data_frame3['Count'] = cnt['Count']
data_frame3['Performance'] = data_frame3['Percent'] / data_frame3['Count']
data_frame3.head(10)
data_frame3['Performance'].max()
data_frame3['Performance'].min()
data_frame3['State'].unique()
sns.set()
plt.rcParams['figure.figsize'] = [15,8]
sns.barplot(x='State', y='Count',hue = 'Gender', data=data_frame3 );
plt.ylabel('Total No. Student')
plt.xlabel('State')
plt.title('Boys and Girls Performance by State')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20848633210934311, 'fraction_numerical': 0.01795185638514892, 'mean_word_length': 9.008163265306122, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '657731', 'license': 'Apache-2.0', 'n_tokens_mistral': 918, 'n_tokens_neox': 869, 'n_words': 138, 'path': 'NAS_Question_2_Girls_VS_Boys_G2_Complete_final.ipynb', 'repo_name': 'shingareshubham/NAS_Class_VIII_2014', 'size': '2451'}