For provincial election purposes, the province of Saskatchewan is…

QuestionAnswered step-by-stepFor provincial election purposes, the province of Saskatchewan is…For provincial election purposes, the province of Saskatchewan is divided into constituencies. Each constituency elects a representative to send to the provincial parliament. Nearly always, each representative belongs to a registered political party. In 2O16, the Saskatchewan Party won the election with a total of 51 out of 61 constituencies. For this question, you will use real election data to determine how many of those wins were a majority victory, i.e. where the Saskatchewan Party won more than half of the votes cast in the constituency.  The main purpose of this question is to practice data manipulation using numpy arrays. You will need all three of: array arithmetic, array relations, and logical array indexing. You should be able to use all three of these techniques in a useful way while solving this problem. Before you start anything, make sure you have imported the numpy module.  Image transcription textThe Saskatchewan Party won a vote majority in 45 constituencies. [‘ ARM RIVER ‘ ‘ BATOCHE ‘ ‘ BIGGAR -SASK VALLEY ‘ ‘ CANNINGTON ‘ ‘ CANORA – PELLY’ ‘WEYBURN – BIG MUDDY ‘ ‘WOOD RIVER ‘ ‘ YORKTON ‘]constituency green ndp pc liberal saskparty wipARM RIVER 241 1457 338 207 6187 0ATHABASCA 53 1756 0 262 644 0BATOCHE 103 2114 0 216 4471 0BIGGAR-SASK VALLEY 162 1453 0 194 5972 0CANNINGTON 133 674 245 133 6444 0CANORA-PELLY 102 1323 414 192 4318 51CARROT RIVER VALLEY 115 1369 0 131 5104 0CUMBERLAND 79 3375 0 352 1610 0CUT KNIFE-TURTLEFORD 90 958 154 255 5765 0CYPRESS HILLS 133 875 382 99 5774 0ESTEVAN 89 635 618 118 5454 0HUMBOLDT-WATROUS 187 1588 0 212 5818 0INDIAN HEAD-MILESTONE 143 1848 225 264 5118 0KELVINGTON-WADENA 108 1354 390 132 5133 218KINDERSLEY 0 522 323 171 4802 0LAST MOUNTAIN-TOUCHWOOD 104 1572 689 212 4274 23LLOYDMINSTER 65 432 0 202 4350 0LUMSDEN-MORSE 179 1655 0 242 6256 0MARTENSVILLE-WARMAN 91 1477 0 179 6854 26MEADOW LAKE 107 1430 0 305 4395 0MELFORT 102 1406 0 150 5579 0MELVILLE-SALTCOATS 0 1595 192 138 5311 0MOOSE JAW NORTH 142 2517 0 194 4425 0MOOSE JAW WAKAMOW 106 2819 0 182 3514 0MOOSOMIN 244 1032 284 191 5142 0PRINCE ALBERT CARLTON 60 2670 0 199 3553 0PRINCE ALBERT NORTHCOTE 88 2752 0 272 2491 0REGINA CORONATION PARK 103 2861 0 245 3008 0REGINA DOUGLAS PARK 401 3242 0 332 2531 0REGINA ELPHINSTONE-CENTRE 178 2648 0 297 1351 0REGINA GARDINER PARK 138 2459 0 294 4259 0REGINA LAKEVIEW 251 4358 0 391 2715 0REGINA NORTHEAST 155 2912 0 186 3920 0REGINA PASQUA 186 3631 174 962 3929 0REGINA ROCHDALE 155 3554 0 293 5769 0REGINA ROSEMONT 146 3994 0 162 3101 0REGINA UNIVERSITY 165 3001 0 401 3418 0REGINA WALSH ACRES 106 2976 0 312 3575 0REGINA WASCANA PLAINS 153 2525 245 287 6107 0ROSETOWN-ELROSE 182 1380 0 146 5939 0ROSTHERN-SHELLBROOK 119 1288 0 468 4724 0SASKATCHEWAN RIVERS 0 2010 0 244 4584 0SASKATOON CENTRE 129 3005 0 203 1928 0SASKATOON CHURCHILL-WILDWOOD 128 3044 0 414 3978 0SASKATOON EASTVIEW 170 3198 0 272 4169 0SASKATOON FAIRVIEW 89 2769 0 308 2951 0SASKATOON MEEWASIN 148 2977 0 307 3500 0SASKATOON NORTHWEST 121 2004 0 254 4514 0SASKATOON NUTANA 190 3822 0 275 2474 0SASKATOON RIVERSDALE 107 2691 0 354 2432 0SASKATOON SILVERSPRING-SUTHERLAND 127 2003 122 303 4482 0SASKATOON SOUTHEAST 104 2169 0 225 5247 0SASKATOON STONEBRIDGE-DAKOTA 149 2300 0 377 6584 0SASKATOON UNIVERSITY 129 2732 101 370 3080 0SASKATOON WESTVIEW 124 3675 0 240 3892 0SASKATOON WILLOWGROVE 129 2196 0 229 6603 0SWIFT CURRENT 103 1112 0 78 6071 0THE BATTLEFORDS 83 2260 0 438 4296 0WEYBURN-BIG MUDDY 155 1260 131 122 6177 0WOOD RIVER 200 991 544 191 6125 0YORKTON 118 1432 0 184 4585 0 The first line of the file is a header that lists all the political parties. The other lines list the name of a constituency and the number of votes won by each party (in the order shown in the header) in that constituency. Write code to open this file and read the election data into two separate lists: one for the constituency names and one for the vote tallies. Then, convert each list to a numpy array. Make sure to maintain the order so that the arrays line up by position (i.e. ARM RIVER is first in the array of constituencies, and its matching votes are first in the array of votes) Test these arrays before you move on! From this point on, you must perform all calculations using arrays rather than lists. Next, develop array that contains the total number of votes cast in each constituency, again making sure to maintain the order of the data. Take good advantage of array operations such as slicing and array arithmetic here. Finally, use the arrays you have created so far to find all of the constituencies where the Sask Party won more than half of the total votes cast in that constituency. Make good use of array relations and logical indexing here. In particular, you can use array relations on two arrays so long as they are the same size; this might be useful to do using the array of total votes that you created in the previous step. Note that you cannot assume what the index of the Sask Party’s vote column will be. Use the header info from the file to find it! Your program should print to the console the number of constituencies where the Sask Party won a majority victory, as well as the names of those constituencies. The output for the program is given above.Computer ScienceEngineering & TechnologyPython ProgrammingCS 11Share Question