May 22, 2017 -- SienaSemanticsSurvey -- Code Breakdown -- Cell #6 & #7


Cell #6:
Some of the questions asked students to rank from 1-7, where 1 would be least positive, and 7 the most positive. Therefore, the code sets up that if a particular question is known to be in the reverse order where 1 corresponded to the most positive, the python code will automatically switch a 1 to a 7, switching a 2 to a 6, 3 to a 5, a 4 will remain a 4, and so on, just replacing the values with their opposites in the bounds of 1-7. The questions that were in the correct order from the first sentence, are left untouched, only the flipped ones are adjusted.

iloc --> works on positions in the data (integer locations only)
_________________________________________________________________________________

Cell #7

Going through each year's survey to find the specific questions that have flipped ranking from 1-7, then finding the corresponding column in the excel data for the survey to identify the columns that need to undergo the python code that will reverse the values to become 1 to 7, 2 to 6, etc. The columns that correspond to these specific flipped questions are listed under the corresponding vectorS14/15/16/17 depending on what year the data was gathered from.

SemanticsS17.iloc[0:9,4:19] --> creates a chart using a sample of data from '17 for the first ten rows (the first being the titles of the columns) and 9 students responses, and the 4th-16th columns and responses.

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