From 85da8c407885eb75efff35ca40df01b7a2df9046 Mon Sep 17 00:00:00 2001 From: Kelden Dradul Dorji Date: Sat, 21 Oct 2017 01:37:05 +0600 Subject: [PATCH 1/2] Update Test.py --- Test.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Test.py b/Test.py index d2d3600..21549a0 100644 --- a/Test.py +++ b/Test.py @@ -4,13 +4,12 @@ import seaborn as sns import matplotlib.pyplot as plt -data_train = pd.read_csv('/home/keldendraduldorji/Desktop/KDD/train.csv') -data_test = pd.read_csv('/home/keldendraduldorji/Desktop/KDD/test.csv') +Grades = pd.read_csv('Grades_Students.csv') +Student = pd.read_csv('student2.csv') #Picks up 3 random samples data_train.sample(3) -#Create a barplot that has assigned x, y values and also legend title name "Sex" -#sns.barplot(x="Embarked", y="Survived", hue="Sex", data=data_train) -#plt.show() # Visualizing the data +sns.barplot(x="Assessment", y="Grade", hue="Type of marking", data=Grades) +plt.show() #sns.pointplot(x="Pclass", y="Survived", hue="Sex", data=data_train, #palette={"male": "blue", "female": "pink"}, #markers=["*", "o"], linestyles=["-", "--"]) @@ -164,4 +163,4 @@ def run_kfold(clf): output = pd.DataFrame({ 'PassengerId' : ids, 'Survived': predictions }) # output.to_csv('titanic-predictions.csv', index = False) -output.head() \ No newline at end of file +output.head() From 40a92bf2555d7755a6c1e94a0fef00b592021f66 Mon Sep 17 00:00:00 2001 From: Kelden Dradul Dorji Date: Sat, 21 Oct 2017 01:49:00 +0600 Subject: [PATCH 2/2] Update Test.py --- Test.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Test.py b/Test.py index 21549a0..5100cf2 100644 --- a/Test.py +++ b/Test.py @@ -4,22 +4,30 @@ import seaborn as sns import matplotlib.pyplot as plt -Grades = pd.read_csv('Grades_Students.csv') +Grades = pd.read_csv('Grades_Students.csv', sep= ',', header=None) Student = pd.read_csv('student2.csv') #Picks up 3 random samples -data_train.sample(3) +Grades.sample(3) sns.barplot(x="Assessment", y="Grade", hue="Type of marking", data=Grades) plt.show() -#sns.pointplot(x="Pclass", y="Survived", hue="Sex", data=data_train, - #palette={"male": "blue", "female": "pink"}, - #markers=["*", "o"], linestyles=["-", "--"]) +print Grades.values +print Grades +plt.bar(Grades[:,0], Grades[:,1], color='g') +plt.ylabel('Frequency') +plt.xlabel('Words') +plt.title('Title') + +plt.show() +sns.pointplot(x="Pclass", y="Survived", hue="Sex", data=Grades, + palette={"male": "blue", "female": "pink"}, + markers=["*", "o"], linestyles=["-", "--"]) #sns pointplot function creates a pointplot that estimates central tendency for #a numeric variable. Your x and y values are assigned along with a legend title. #Regarding data , palette assigns a color to a variable. Markers are the symbols of the #legends in this case male and female. linestyles are used to specify whether a line in the graph looks like # ----- or straight line. -#plt.show() +plt.show() def simplify_ages(df):