May 24, 2017 -- SienaSemanticsSurvey -- Code Breakdown -- Cell #16 & #17

Graphs only successfully generate when the Gender choice in Cell #10 is "" --> any other choice input generates an error that 'Gender' is not properly defined and can't produce the bar graphs

The Graphs divide the data so that the first graph (Graph Part1) produces a graph inclusive of data regarding Science and Math questions from each year's semantics survey. The second graph (Graph Part2) produces a graph inclusive of data regarding Engineering, Technology, and Career questions from each year's semantics survey.
_________________________________________________________________________________
Cell #16
"Graph Part1 - Semantics in STEM (Science and Math) for S14, S15, S16, S17"

NTitle --> "variable" that the title "SEMANTICS (SCIENCE AND MATH) IN STEM" is saved as and is eventually called in the plot as title=NTitle

Calls each year's data for the first ten rows of the tables that were created and all of the corresponding columns of data, too, as these rows relate to the survey questions involving science and math questions.
The question/topic that was included under "name" is listed on the x-axis and labels each group of bars according to correlating topic. The colored bars each match one of the four years of data according to the legend listed, and the colored bars represent the mean calculated and listed in the chart. Therefore, the y-axis is the mean, where values range between 4-6, which can also be seen by looking at the individual years' survey data on the charts. The higher the colored bar, the higher the mean, and the higher the positive student reaction related to that topic. For example, students find science more fascinating than they find math appealing. The thin black line that is placed at the top of each colored bar represents the SEM that was included for the calculation and represents the give and take that is attributed to the data.
_________________________________________________________________________________
Cell #17
"Graph Part2 - Semantics in STEM (Engineering, Technology and Career) for S14

NTitle --> "variable" that the title "SEMANTICS (ENGINEERING, TECHNOLOGY AND CAREER) IN STEM" is saved as and is eventually called in the plot as title=NTitle

Calls each year's data for the 10-25 rows of the tables that were created and all of the corresponding columns of data, too, as these rows relate to the survey questions that have to do with engineering, technology and career questions
The question/topic that was included under "name" is listed on the x-axis and labels each group of bars according to correlating topic. The colored bars each match one of the four years of data according to the legend listed, and the colored bars represent the mean calculated and listed in the chart. Therefore, the y-axis is the mean, where values range between 5-6, which can also be seen by looking at the individual years' survey data on the charts. The higher the colored bar, the higher the mean, and the higher the positive student reaction related to that topic. . The thin black line that is placed at the top of each colored bar represents the SEM that was included for the calculation and represents the give and take that is attributed to the data.

CONFUSED BECAUSE THE FIRST 10 GROUPS OF DATA ON THIS GRAPH ARE REPEATED FROM GRAPH 1 AND RELATE TO SCIENCE/MATH --> it's not until the last five groups of data that the topics have to do with engineering instead of science/math. The rows that the data is calling needs to change to no longer pull the data for science/math survey questions for this graph but instead only the engineering, technology, and career questions.

  • If you enter:

S14G_dat = SemanticsS14_dat.iloc[10:25,:]
S15G_dat = SemanticsS15_dat.iloc[10:25,:]
S16G_dat = SemanticsS16_dat.iloc[10:25,:]
S17G_dat = SemanticsS17_dat.iloc[1:25,:]

the graph responds by only graphing the 2017 survey data for the topics from rows 1-9 and then correctly displays the questions for engineering, technology and career for all four years. But when all four years are entered for display 10:25, the graph shifts to only display up to the tenth row instead of from 10-25.

Resolution:
Turns out that the data was for the correct rows (10:25), but the labels were what was wrong.  The fourth to last line: ax.set_xticklabels(group_label, fontsize=12) needs to be adjusted to instead say:
ax.set_ticklabels(group_labels[10:25], fontsize=12)

Comments

Popular posts from this blog

6/14/17 Notes

6/06/17 Notes (formatting code and searching for a specific person)

May 22, 2017 -- SienaSemanticsSurvey -- Code Breakdown -- Cell #8