{"id":307,"date":"2022-05-24T19:17:19","date_gmt":"2022-05-24T18:17:19","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/?page_id=307"},"modified":"2022-05-24T19:31:30","modified_gmt":"2022-05-24T18:31:30","slug":"count-occurrence","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/count-occurrence\/","title":{"rendered":"Count Occurrence"},"content":{"rendered":"<p>This algorithm is often used for counting data items in an array which match a certain condition, for example counting a number of exam passes\/different grades or counting the number of &#8216;yes&#8217; responses when processing questionnaire data.<\/p>\n<p><strong style=\"color: red\">Example in Pseudocode<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-311\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193053\/Screenshot-2022-05-24-192943-300x170.png\" alt=\"\" width=\"545\" height=\"309\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193053\/Screenshot-2022-05-24-192943-300x170.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193053\/Screenshot-2022-05-24-192943-1024x579.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193053\/Screenshot-2022-05-24-192943-768x434.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193053\/Screenshot-2022-05-24-192943-624x353.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193053\/Screenshot-2022-05-24-192943.png 1156w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/p>\n<p><strong style=\"color: red\">Example in Python<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-312\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193118\/Screenshot-2022-05-24-192620-300x141.png\" alt=\"\" width=\"891\" height=\"419\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193118\/Screenshot-2022-05-24-192620-300x141.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193118\/Screenshot-2022-05-24-192620-1024x483.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193118\/Screenshot-2022-05-24-192620-768x362.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193118\/Screenshot-2022-05-24-192620-624x294.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24193118\/Screenshot-2022-05-24-192620.png 1260w\" sizes=\"auto, (max-width: 891px) 100vw, 891px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This algorithm is often used for counting data items in an array which match a certain condition, for example counting a number of exam passes\/different grades or counting the number of &#8216;yes&#8217; responses when processing questionnaire data. Example in Pseudocode Example in Python<\/p>\n","protected":false},"author":79984,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-307","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/users\/79984"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/comments?post=307"}],"version-history":[{"count":3,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/307\/revisions"}],"predecessor-version":[{"id":313,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/307\/revisions\/313"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/media?parent=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}