{"cells":[{"metadata":{"_uuid":"0255e090b0ff8c4d357cd023428459ac4eb756e6"},"cell_type":"markdown","source":"Lets pull the data."},{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport os\nimport matplotlib.pyplot as plt\nimport seaborn as sns \ndata=pd.read_csv('../input/StudentsPerformance.csv')\ndata.head()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"99229c95e7b0c18dc509359b1a997f2e26706035"},"cell_type":"markdown","source":"By using Labelencoder We can encode all catogories."},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"from sklearn.preprocessing import LabelEncoder\nlabel_data=[]\nfor i in range(5):\n    label=LabelEncoder()\n    label.fit(data.iloc[:,i])\n    new_data=label.transform(data.iloc[:,i])\n    print(label.classes_)\n    label_data.append(new_data)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"4ec93e736142ab821be5f7b705012cbc9084772a"},"cell_type":"markdown","source":"Lets combine the data again."},{"metadata":{"trusted":true,"_uuid":"dcaed85bc1d02166005a549ea689ede2ba1da39a"},"cell_type":"code","source":"data1=data[['math score', 'reading score',\n       'writing score']]\nlabel_data=pd.DataFrame(label_data).T\nframes=[label_data,data1]\nfinal_data=pd.concat(frames,axis=1)\nfinal_data.columns=['gender', 'race/ethnicity', 'parental level of education', 'lunch',\n       'test preparation course', 'math score', 'reading score',\n       'writing score']","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"75379a05151186fb000eecb44cc2a53b653fca10"},"cell_type":"markdown","source":"Lets find the dependencies of performance of student on marks."},{"metadata":{"trusted":true,"_uuid":"d8982b481dab0665fe140336930f9b64a15f0f87"},"cell_type":"code","source":"plt.figure(figsize=(10,10))\nsns.heatmap(final_data.corr(),annot=True,vmax=1,vmin=-1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"2de81b9f8f3ce13f85209218db1b143eb968761c"},"cell_type":"code","source":"final_data.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"e1c18e026f2b9d01c0844ec8a136d9bd4fd15cf5"},"cell_type":"code","source":"plt.figure(figsize=(10,4))\nsns.boxplot(data['race/ethnicity'],data['math score'])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"e4147c95b70fb5fa53f6b7f60b24ba453cc1f6ee"},"cell_type":"code","source":"plt.figure(figsize=(10,4))\nsns.boxplot(data['parental level of education'],data['math score'])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"7f0f7aed0d3d41862e712339453a7b170ed03fa1"},"cell_type":"code","source":"plt.figure(figsize=(6,4))\nsns.boxplot(data['test preparation course'],data['math score'])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"6b3006eac8154b572c2a84bebb8efe50a05fcc21"},"cell_type":"code","source":"plt.figure(figsize=(6,4))\nsns.boxplot(data['lunch'],data['math score'])","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}