from pandas_datareader import data, wb
import pandas as pd
import numpy as np
import datetime
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
staff = pd.read_csv('staff_my_voice.csv')
students = pd.read_csv('student_my_voice.csv')
staff.rename(columns = {'Total in Agreement': 'Total Agree', 'Disagree.1':'Strongly Disagree'}, inplace=True)
students.rename(columns = {'Total in Agreement': 'Total Agree', 'Disagree.1':'Strongly Disagree'}, inplace=True)

for c in staff.columns[2:-1]:
    staff[c] = staff[c].str.replace('%', '')
    staff[c] = staff[c].astype(float)
    students[c] = students[c].str.replace('%', '')
    students[c] = students[c].astype(float)

staff.head()
Category Question Total Agree Strongly Agree Agree Undecided Disagree Strongly Disagree Total Disagree Did Not Answer Total Positive Wording
0 Belonging 1. I feel valued for my unique skills and talents 68.9 15.1 53.8 11.8 14.3 5.0 19.3 0.0 68.9 0
1 Belonging 2. School is a welcoming and friendly place 79.0 13.4 65.5 15.1 4.2 1.7 5.9 0.0 79.0 0
2 Belonging 3. I am proud of my school 82.9 32.5 50.4 9.4 6.0 1.7 7.7 1.7 82.9 0
3 Belonging 4. I think bullying is a problem at my school 50.8 11.0 39.8 23.7 23.7 1.7 25.4 0.8 25.4 1
4 Belonging 5. I feel comfortable in the staff room 64.4 16.1 48.3 15.3 12.7 7.6 20.3 0.8 64.4 0

Explanation of the columns in the table above:

  • Each question has a general ‘Category’
  • Total Agree is the sum of Strongly Agree and Agree
  • Total Disagree is the sum of Disagree and Strongly Disagree
  • Wording is 0 for positive (something we want to agree highly) and 1 for negative (statements we would want to disagree with).
  • Total Positive is equal to Total Agree if Wording is positive and Total Disagree if Wording is negative. The higher the better.

Staff Analysis

Below you can see the average of total percentage of positive answers for each of the main categories. In general it seems staff has fun, is confident, enjoys support from colleagues. However it seems administration, leadership, and communication could be areas of improvement.


catStaff = staff.groupby('Category')
catStaff['Total Positive'].mean()
Category
Administration and Communication    54.283333
Belonging                           63.650000
Confidence to Take Action           83.200000
Curiosity & Creativity              66.362500
Fun & Excitement                    88.742857
Heroes                              84.287500
Leadership & Responsibility         62.957143
Sense of Accomplishment             69.866667
Spirit of Adventure                 65.557143
Name: Total Positive, dtype: float64

Below is a list of the questions that were low (<50%) positive answers. Some things to look into is that majority of staff (50.8%) agree that bullying is a problem while only 25.5% disagree. This is why there is only a 25.4% persent Total Positive amount. Since we would want everyone to agree that bullying is not a problem at our school. This is something to look into and so is lack of meaningful professional development #36, lack of effective communication #60, lack of decision making, and lack of administration learning from staff.

posStaff = staff[staff['Total Positive'] < 50.0]

# posStaff.set_index('Question', inplace=True)

posStaff = posStaff.reindex(columns=["Category", "Question", "Total Agree", "Strongly Agree", "Agree", "Undecided", 
                                     "Disagree", "Strongly Disagree","Did Not Answer", "Total Disagree", "Total Positive",
                                     "Wording"])
posStaff.head(len(posStaff))
Category Question Total Agree Strongly Agree Agree Undecided Disagree Strongly Disagree Did Not Answer Total Disagree Total Positive Wording
3 Belonging 4. I think bullying is a problem at my school 50.8 11.0 39.8 23.7 23.7 1.7 0.8 25.4 25.4 1
5 Belonging 6. Building administration makes an effort to ... 43.6 9.4 34.2 17.1 23.1 16.2 1.7 39.3 43.6 0
20 Sense of Accomplishment 21. I am recognized when I try my best 44.4 7.7 36.8 24.8 25.6 5.1 1.7 30.7 44.4 0
35 Curiosity & Creativity 36. Meaningful professional development opport... 36.4 4.2 32.2 22.0 18.6 22.9 0.8 41.5 36.4 0
36 Curiosity & Creativity 37. I feel comfortable asking questions in sta... 44.4 11.1 33.3 20.5 20.5 14.5 1.7 35.0 44.4 0
37 Spirit of Adventure 38. Setting yearly goals with my supervisor is... 43.7 10.1 33.6 16.8 26.1 13.4 0.0 39.5 43.7 0
43 Spirit of Adventure 44. I am excited to tell my colleagues when I ... 47.9 7.7 40.2 23.9 19.7 8.5 1.7 28.2 47.9 0
45 Leadership & Responsibility 46. My colleagues see me as a leader 46.2 7.6 38.7 39.5 13.4 0.8 0.0 14.2 46.2 0
46 Leadership & Responsibility 47. I have a voice in decision making at school 39.0 4.2 34.7 21.2 23.7 16.1 0.8 39.8 39.0 0
50 Leadership & Responsibility 51. Building administration is willing to lear... 39.3 6.8 32.5 25.6 17.9 17.1 1.7 35.0 39.3 0
53 Confidence to Take Action 54. I feel confident voicing my honest opinion... 46.6 5.9 40.7 18.6 22.9 11.9 0.8 34.8 46.6 0
59 Administration and Communication 60. We communicate effectively in our building 27.7 1.7 26.1 26.1 30.3 16.0 0.0 46.3 27.7 0
61 Administration and Communication 62. Building administration knows my professio... 46.6 6.9 39.7 17.2 22.4 13.8 2.5 36.2 46.6 0
# Data to plot
fig, axes = plt.subplots(7, 2, figsize=(10,20))
 
# Plot
for i, (idx, row) in enumerate(posStaff.set_index('Question').iterrows()):
    ax = axes[i // 2, i % 2]
    perc = row[2:-3]
    ax.pie(perc, labels=list(row[2:-3].index),autopct='%1.1f%%')
    ax.set_title(idx)
fig.delaxes(axes[6,1])

fig.subplots_adjust(wspace=.5)

png

Student Analysis

Doing a similar analysis for the student data provides more information on the overall thoughts of the students. Below are the breakdowns of each of the categories for the students.

catStudent = students.groupby('Category')
catStudent['Total Positive'].mean()

Category
Belonging                      52.250000
Confidence to Take Action      72.050000
Curiosity & Creativity         60.410000
Fun & Excitement               49.100000
Heroes                         56.977778
Leadership & Responsibility    47.428571
Sense of Accomplishment        60.122222
Spirit of Adventure            57.514286
Name: Total Positive, dtype: float64

Not a very good prognosis for the students compared to the way the staff feel. Student seem to have high confidence, curiosity, and sense of accomplishment. In general these responses do not seem as positive as the staff. However more of the students chose undecided as there answer compared with the staff. This could influence the outcome either way but it is something for us to make sure students are aware of an for them to be more decisive when taking the survey.

print('Students mean undecided percentage: %{:.2f}.\nStaff mean undecided percentage: %{:.2f}.'.format(students['Undecided'].mean(), staff['Undecided'].mean()))
Students mean undecided percentage: %25.14.
Staff mean undecided percentage: %13.83.
posStudent = students[students['Total Positive'] < 50.0]

# posStaff.set_index('Question', inplace=True)

posStudent = posStudent.reindex(columns=["Category", "Question", "Total Agree", "Strongly Agree", "Agree", "Undecided", 
                                     "Disagree", "Strongly Disagree","Did Not Answer", "Total Disagree", "Total Positive",
                                     "Wording"])
posStudent.head(len(posStudent))
Category Question Total Agree Strongly Agree Agree Undecided Disagree Strongly Disagree Did Not Answer Total Disagree Total Positive Wording
2 Belonging 3. Teachers make an effort to get to know me. 47.1 10.5 36.6 32.1 15.6 5.1 0.2 20.7 47.1 0
4 Belonging 5. Teachers care about my problems and feelings. 38.5 7.1 31.4 40.0 14.7 6.8 1.0 21.5 38.5 0
6 Belonging 7. I am a valued member of my school community. 37.9 7.5 30.4 36.1 18.1 7.8 1.1 25.9 37.9 0
7 Belonging 8. I think bullying is a problem at my school. 27.7 8.7 19.0 32.9 30.3 9.0 1.6 39.3 39.3 1
12 Heroes 13. Teachers care if I am absent from school. 47.0 10.3 36.7 30.7 16.2 6.1 1.2 22.3 47.0 0
15 Heroes 16. Students respect each other. 34.9 4.0 30.8 39.2 16.8 9.1 1.8 25.9 34.9 0
16 Heroes 17. Adults at this school listen to students' ... 38.9 6.7 32.3 38.3 15.0 7.7 2.4 22.7 38.9 0
21 Sense of Accomplishment 22. Teachers recognize me when I try my best. 45.6 10.4 35.1 32.6 14.7 7.1 1.4 21.8 45.6 0
22 Sense of Accomplishment 23. Teachers let my parents know what I do well. 31.3 7.1 24.1 32.4 22.6 13.8 1.6 36.4 31.3 0
26 Fun & Excitement 27. I enjoy being at school. 46.4 8.7 37.6 26.4 17.5 9.7 0.7 27.2 46.4 0
28 Fun & Excitement 29. Teachers make school an exciting place to ... 37.9 5.1 32.8 36.9 17.8 7.3 0.1 25.1 37.9 0
29 Fun & Excitement 30. School is boring. 51.8 20.5 31.3 24.4 19.1 4.6 0.8 23.7 23.7 1
31 Fun & Excitement 32. Teachers have fun at school. 44.9 8.1 36.8 38.9 10.2 6.0 1.2 16.2 44.9 0
37 Curiosity & Creativity 38. My classes help me understand what is happ... 36.4 4.7 31.7 26.5 24.7 12.4 0.9 37.1 36.4 0
42 Curiosity & Creativity 43. Students work with adults to find solution... 43.1 8.4 34.7 36.1 13.4 7.3 2.2 20.7 43.1 0
43 Spirit of Adventure 44. I like challenging assignments. 40.9 8.9 32.0 27.6 21.0 10.6 0.6 31.6 40.9 0
45 Spirit of Adventure 46. Students are supportive of each other. 43.0 4.4 38.6 34.6 14.7 7.7 0.6 22.4 43.0 0
49 Spirit of Adventure 50. I am excited to tell my friends when I get... 49.2 14.0 35.1 26.4 17.9 6.5 2.0 24.4 49.2 0
50 Leadership & Responsibility 51. Students have a voice in decision making a... 39.8 5.1 34.6 29.6 20.3 10.3 0.6 30.6 39.8 0
52 Leadership & Responsibility 53. Other students see me as a leader. 33.0 6.8 26.1 41.1 16.8 9.1 0.2 25.9 33.0 0
54 Leadership & Responsibility 55. Teachers are willing to learn from students. 45.4 7.1 38.3 31.0 14.5 9.0 1.9 23.5 45.4 0
56 Leadership & Responsibility 57. I know the goals my school is working on t... 32.9 8.9 23.9 29.1 25.8 12.2 2.1 38.0 32.9 0
66 Confidence to Take Action 67. Students develop programs that improve the... 47.0 8.9 38.1 35.4 11.6 6.0 1.6 17.6 47.0 0

The above table shows the questions with more negative answers than positive. However looking at the outcomes many of the responses have a high percentage of Undecided answers, most of them having over a third of the answers being undecided. In order to examine these questions more we need to adjust the percentages of the other responses. My choice is to calculate new percentages for Strongly Agree, Agree, Disagree, and Strongly Agree without the students who chose Undecided. Then we will update the Total Positive column to reflect these updated percentages.

# cols = list(students)
cols = [ 'Strongly Agree','Agree', 'Disagree', 'Strongly Disagree']
# cols = [e for e in cols if e not in ('Total Agree','Undecided', 'Did Not Answer', 'Total Disagree', 'Total Positive', 'Wording')]
students['TotalDecided'] = students[cols].sum(axis=1)
decidedStudents = students.copy()
decidedStudents['Strongly Agree'] = round(100*(students['Strongly Agree']/students['TotalDecided']),2)
decidedStudents['Agree'] = round(100*(students['Agree']/students['TotalDecided']),2)
decidedStudents['Disagree'] = round(100*(students['Disagree']/students['TotalDecided']),2)
decidedStudents['Strongly Disagree'] = round(100*(students['Strongly Disagree']/students['TotalDecided']),2)
decidedStudents['Total Agree'] = decidedStudents['Strongly Agree'] + decidedStudents['Agree']
decidedStudents['Total Disagree'] = decidedStudents['Strongly Disagree'] + decidedStudents['Disagree']
decidedStudents['Total Positive'] = np.where(decidedStudents['Wording'] == 0, decidedStudents['Total Agree'],decidedStudents['Total Disagree']) 


After eliminating the undecided students it looks a lot more positive for the total feeling of the student body. For the most part the students are positive with high confidence levels and low fun and responsibility.

catDecStudent = decidedStudents.groupby('Category')
catDecStudent['Total Positive'].mean()
Category
Belonging                      72.503750
Confidence to Take Action      88.844000
Curiosity & Creativity         77.431000
Fun & Excitement               69.171429
Heroes                         75.974444
Leadership & Responsibility    67.010000
Sense of Accomplishment        77.563333
Spirit of Adventure            74.602857
Name: Total Positive, dtype: float64
posDecStudent = decidedStudents[decidedStudents['Total Positive'] < 50.0]

# posStaff.set_index('Question', inplace=True)

posDecStudent = posDecStudent.reindex(columns=["Category", "Question", "Total Agree", "Strongly Agree", "Agree", "Undecided", 
                                     "Disagree", "Strongly Disagree","Did Not Answer", "Total Disagree", "Total Positive",
                                     "Wording"])
posDecStudent.head(len(posDecStudent))
Category Question Total Agree Strongly Agree Agree Undecided Disagree Strongly Disagree Did Not Answer Total Disagree Total Positive Wording
22 Sense of Accomplishment 23. Teachers let my parents know what I do well. 46.15 10.50 35.65 32.4 33.43 20.41 1.6 53.84 46.15 0
29 Fun & Excitement 30. School is boring. 68.61 27.15 41.46 24.4 25.30 6.09 0.8 31.39 31.39 1
37 Curiosity & Creativity 38. My classes help me understand what is happ... 49.52 6.39 43.13 26.5 33.61 16.87 0.9 50.48 49.52 0
56 Leadership & Responsibility 57. I know the goals my school is working on t... 46.33 12.57 33.76 29.1 36.44 17.23 2.1 53.67 46.33 0

After eliminating the undecided students and calculating new percentages based off of the decisive answers provides us with only four questions that have negative total answers. These four topics are things that we can do better as a staff to help students feel more welcome, less bored, and more appreciated. This might not be the best method of determining what the undecided students would have on the population. What we will do in the future is to make sure students are more decisive when filling out the survey as many of the questions had over one third of the population Undecided. Of the students that did answer it was overall pretty positive and also gives the staff direction on the four top priorties to focus our efforts to improve the school culture.