{"id":1039,"date":"2016-02-18T16:00:40","date_gmt":"2016-02-18T16:00:40","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/?p=1039"},"modified":"2016-02-18T16:01:17","modified_gmt":"2016-02-18T16:01:17","slug":"python-tables","status":"publish","type":"post","link":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/2016\/02\/18\/python-tables\/","title":{"rendered":"Python Tables"},"content":{"rendered":"<p><a href=\"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/02\/table.png\"><img decoding=\"async\" data-attachment-id=\"1040\" data-permalink=\"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/2016\/02\/18\/python-tables\/table\/\" data-orig-file=\"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/02\/table.png\" data-orig-size=\"286,415\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"table\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/glow-prod-nl.s3.eu-west-1.amazonaws.com\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/02\/table-207x300.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Security-Token=IQoJb3JpZ2luX2VjEEoaCWV1LXdlc3QtMSJHMEUCIQD2TVV66Ef1oPC9IfwNRhTKD%2FhkgcF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2B6DR%2B8OoqmckqSrHGZhHYCsJ%2FDd6EVAW7goDC99z%2Fr5NN%2Bu3afbKWyHbiUUTvjTv3krwIvTIGKv63yAz6%2FGh%2F2TRxSxKRPn1UDNjj6Zf%2BWk5lpx830x4TKVWhwAM%2FojpBkRSjheKUOOqtYha3hmJr53pmx%2FEtpzwrmOvrpuzQIDCOZwKEpguCYtzvJ7bPdh645ljQlUJ0bW1MibcZhij&amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIAT7MQN47UTCFPPRU3%2F20260714%2Feu-west-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20260714T100408Z&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Expires=900&amp;X-Amz-Signature=9b8d18f1c627cdcb2934f8fa6ade84cb2430abd16300b2376c0c4cbed5192ac4\" data-large-file=\"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/02\/table.png\" class=\"alignright wp-image-1040 size-medium\" src=\"https:\/\/glow-prod-nl.s3.eu-west-1.amazonaws.com\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/02\/table-207x300.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&#038;X-Amz-Security-Token=IQoJb3JpZ2luX2VjEEoaCWV1LXdlc3QtMSJHMEUCIQD2TVV66Ef1oPC9IfwNRhTKD%2FhkgcFJM7YGg0klUQHayQIgfOeDa6i3EiQXLmm90zaox3%2BEc6DDMeRHd%2F6svd%2BC5WMquQUIExAFGgwyNzM1NzAxOTU0MzMiDOqCJzrXrnT4lqRebSqWBaUJdkj85fijSMGuoyCt2eFf2SWsksRiIYWdoLLfNpKppo2NsO4Y5Oc6HVnFAYXsGJpS9%2BKy88vJTNKjH5bhIXJQfF01h5FA9XtKqKcG7xO7Jvk76IFHPZKtLG7LQRK5vPvIVVwfyXsta3ePr11SQDrYSfC1THBhUqa137EeGoIX3RD%2Fx4IcDzAkYk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%2Feu-west-1%2Fs3%2Faws4_request&#038;X-Amz-Date=20260714T100408Z&#038;X-Amz-SignedHeaders=host&#038;X-Amz-Expires=900&#038;X-Amz-Signature=9b8d18f1c627cdcb2934f8fa6ade84cb2430abd16300b2376c0c4cbed5192ac4\" alt=\"table\" width=\"207\" height=\"300\" srcset=\"https:\/\/glow-prod-nl.s3.eu-west-1.amazonaws.com\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/02\/table-207x300.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Security-Token=IQoJb3JpZ2luX2VjEEoaCWV1LXdlc3QtMSJHMEUCIQD2TVV66Ef1oPC9IfwNRhTKD%2FhkgcFJM7YGg0klUQHayQIgfOeDa6i3EiQXLmm90zaox3%2BEc6DDMeRHd%2F6svd%2BC5WMquQUIExAFGgwyNzM1NzAxOTU0MzMiDOqCJzrXrnT4lqRebSqWBaUJdkj85fijSMGuoyCt2eFf2SWsksRiIYWdoLLfNpKppo2NsO4Y5Oc6HVnFAYXsGJpS9%2BKy88vJTNKjH5bhIXJQfF01h5FA9XtKqKcG7xO7Jvk76IFHPZKtLG7LQRK5vPvIVVwfyXsta3ePr11SQDrYSfC1THBhUqa137EeGoIX3RD%2Fx4IcDzAkYkCy9cc3eSpqPLac%2BOXIDkeNg%2BdhvuIlrahG80ETiK3Aco%2B4pgSXN05JCbCpKbipxwVfUK467FTNKRB3GdMHrLk07YhENF%2BPcgct4abisYvPYk7of8YJ11cba9yWMD2E871GH5dQdu1AkviR7IjMFhrZhh4ais%2Fc74Vwj%2FwxGWoacVjCG4vcY1iTwv%2BK1JWGG%2B6RNgn4i92OX4oQcqRzI6zciO5ACk2VrV1hcjOBTep8bRUzubfUpICaRr0d46K%2BAES3LBTxLPq1nwgz0bgCs8vE8E4e%2FVWvDJUYFr12Bs5g8dcEZ0R%2FEGuvRFDb9B6JnAdcWpUEzXlBx1tR%2Fl0ORcxL7qvKaaLHii8DT3PgYLwPYiZEeq%2BJcHgVsE2na1kcvf3AkUHm4aTYjRYyF8Zo8GZcWIC2nKbAuqRwzXMt7ml10jfTdhrsH7DaEPcOjmjeaY9O4O6VIozZRlcigRRrHw9VSLJn819d1VfXTP0qAUw1Bfv3VQTJjGsoYoUQZC3WcAHFbgS7IO9c%2BZjyawCa3JsSqznoYQY9iDDaRcJ47xZsBuceYcoAl4VV%2BNh1t%2FQHUnIf5QRz6hB2Lqc1eMIOA10rlWaPa4W8bGNN6E%2Bn%2B4p41T9E2TO9%2BpEWt7tIa7ixwq0TsGAxiDsSwKD1DZmvwmD88KzSDjimvo3JS9D5WIP751CScHaCHWHooJOlMPL%2F19IGOrEBNhLhVFRLouyPDmbodPfOGbvm%2B6DR%2B8OoqmckqSrHGZhHYCsJ%2FDd6EVAW7goDC99z%2Fr5NN%2Bu3afbKWyHbiUUTvjTv3krwIvTIGKv63yAz6%2FGh%2F2TRxSxKRPn1UDNjj6Zf%2BWk5lpx830x4TKVWhwAM%2FojpBkRSjheKUOOqtYha3hmJr53pmx%2FEtpzwrmOvrpuzQIDCOZwKEpguCYtzvJ7bPdh645ljQlUJ0bW1MibcZhij&amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIAT7MQN47UTCFPPRU3%2F20260714%2Feu-west-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20260714T100408Z&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Expires=900&amp;X-Amz-Signature=9b8d18f1c627cdcb2934f8fa6ade84cb2430abd16300b2376c0c4cbed5192ac4 207w, https:\/\/glow-prod-nl.s3.eu-west-1.amazonaws.com\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/02\/table-103x150.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Security-Token=IQoJb3JpZ2luX2VjEEoaCWV1LXdlc3QtMSJHMEUCIQD2TVV66Ef1oPC9IfwNRhTKD%2FhkgcFJM7YGg0klUQHayQIgfOeD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ZhHYCsJ%2FDd6EVAW7goDC99z%2Fr5NN%2Bu3afbKWyHbiUUTvjTv3krwIvTIGKv63yAz6%2FGh%2F2TRxSxKRPn1UDNjj6Zf%2BWk5lpx830x4TKVWhwAM%2FojpBkRSjheKUOOqtYha3hmJr53pmx%2FEtpzwrmOvrpuzQIDCOZwKEpguCYtzvJ7bPdh645ljQlUJ0bW1MibcZhij&amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIAT7MQN47UTCFPPRU3%2F20260714%2Feu-west-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20260714T100408Z&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Expires=900&amp;X-Amz-Signature=5d9f18de4ed44f8c39c77782a5d19c2f5083083706e64527dea25348cb56207e 103w, https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/02\/table.png 286w\" sizes=\"(max-width: 207px) 100vw, 207px\" \/><\/a>I was asked in class how we can create a table in Python. There are a number of ways to do this but the easiest is probably to use the<a href=\"https:\/\/docs.python.org\/3.1\/library\/string.html#format-string-syntax\" target=\"_blank\"> .format method<\/a>.<\/p>\n<p>The program reads in data from a CSV file before displaying the information in a two column table. There is a lot of internal commentary you can strip out leaving just the code.<\/p>\n<p>The main part of the program is line 28. Where the contents of names and scores are displayed one line at a time with padding to make them appear to be in a table.<\/p>\n<p><!--more--><\/p>\n<div style=\"background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em\">\n<table>\n<tbody>\n<tr>\n<td>\n<pre style=\"margin: 0;line-height: 125%\"> 1\r\n 2\r\n 3\r\n 4\r\n 5\r\n 6\r\n 7\r\n 8\r\n 9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n23\r\n24\r\n25\r\n26\r\n27\r\n28\r\n29<\/pre>\n<\/td>\n<td>\n<pre style=\"margin: 0;line-height: 125%\"><span style=\"color: #999988;font-style: italic\">#Read in 10 sets of data from a CSV File<\/span>\r\n\r\nnames<span style=\"font-weight: bold\">=<\/span>[<span style=\"color: #bb8844\">\"\"<\/span>]<span style=\"font-weight: bold\">*<\/span><span style=\"color: #009999\">10<\/span>\r\nscores<span style=\"font-weight: bold\">=<\/span>[<span style=\"color: #009999\">0<\/span>]<span style=\"font-weight: bold\">*<\/span><span style=\"color: #009999\">10<\/span>\r\ncsv_file <span style=\"font-weight: bold\">=<\/span> <span style=\"color: #999999\">open<\/span>(<span style=\"color: #bb8844\">'highscores.csv'<\/span>,<span style=\"color: #bb8844\">'r'<\/span>)   <span style=\"color: #999988;font-style: italic\"># 1. Open file<\/span>\r\n<span style=\"font-weight: bold\">for<\/span> index <span style=\"font-weight: bold\">in<\/span> <span style=\"color: #999999\">range<\/span>(<span style=\"color: #009999\">10<\/span>):                 <span style=\"color: #999988;font-style: italic\"># 2. read data from file<\/span>\r\n    names[index],scores[index]<span style=\"font-weight: bold\">=<\/span>csv_file<span style=\"font-weight: bold\">.<\/span>readline()[:<span style=\"font-weight: bold\">-<\/span><span style=\"color: #009999\">1<\/span>]<span style=\"font-weight: bold\">.<\/span>split(<span style=\"color: #bb8844\">','<\/span>)     <span style=\"color: #999988;font-style: italic\"># split into two variables after removing newline<\/span>\r\n    scores[index]<span style=\"font-weight: bold\">=<\/span><span style=\"color: #999999\">int<\/span>(scores[index])    <span style=\"color: #999988;font-style: italic\"># change score to Integer<\/span>\r\ncsv_file<span style=\"font-weight: bold\">.<\/span>close()                        <span style=\"color: #999988;font-style: italic\"># 3. close file<\/span>\r\n\r\n<span style=\"color: #999988;font-style: italic\"># Using format method to justify the coloumns<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># .format is used to change the format of a string<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># eg.    '{:&lt;5}{:&gt;10}'.format('Name','Score')<\/span>\r\n<span style=\"color: #999988;font-style: italic\">#          1st   2nd            1st    2nd<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># &lt; left align<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># &gt; right align<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># ^ centre align<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># the number is the size the string is padded too<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># the above example would create a string like the one below A is used for a 1st, B for 2nd<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># AAAAABBBBBBBBBB<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># so Dan and 2343 would give<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># DanAABBBBBB2343 where AABBBBBB would be spaces<\/span>\r\n\r\n<span style=\"font-weight: bold\">print<\/span>(<span style=\"color: #bb8844\">'{:*^15}'<\/span><span style=\"font-weight: bold\">.<\/span>format(<span style=\"color: #bb8844\">'High Scores'<\/span>)) <span style=\"color: #999988;font-style: italic\"># The * is used instead of spaces for padding<\/span>\r\n<span style=\"font-weight: bold\">print<\/span>(<span style=\"color: #bb8844\">'-'<\/span><span style=\"font-weight: bold\">*<\/span><span style=\"color: #009999\">15<\/span>) <span style=\"color: #999988;font-style: italic\"># 15 dashes<\/span>\r\n<span style=\"font-weight: bold\">print<\/span>(<span style=\"color: #bb8844\">'{:&lt;5}{:&gt;10}'<\/span><span style=\"font-weight: bold\">.<\/span>format(<span style=\"color: #bb8844\">'Name'<\/span>,<span style=\"color: #bb8844\">'Score'<\/span>)) <span style=\"color: #999988;font-style: italic\"># Print the headings (outside of loop)<\/span>\r\n<span style=\"font-weight: bold\">for<\/span> index <span style=\"font-weight: bold\">in<\/span> <span style=\"color: #999999\">range<\/span>(<span style=\"color: #009999\">10<\/span>):\r\n    <span style=\"font-weight: bold\">print<\/span>(<span style=\"color: #bb8844\">'{:&lt;5}{:&gt;10}'<\/span><span style=\"font-weight: bold\">.<\/span>format(names[index],scores[index])) <span style=\"color: #999988;font-style: italic\"># display each line<\/span>\r\n    \r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was asked in class how we can create a table in Python. There are a number of ways to do this but the easiest is probably to use the .format method. The program reads in data from a CSV file before displaying the information in a two column table. There is a lot of &hellip;<\/p>\n","protected":false},"author":32,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17935,17932,17009],"tags":[125745,446],"class_list":["post-1039","post","type-post","status-publish","format-standard","hentry","category-algorithm-specification","category-computational-constructs","category-software-design-devlopment","tag-csv","tag-format"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/comments?post=1039"}],"version-history":[{"count":3,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1039\/revisions"}],"predecessor-version":[{"id":1043,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1039\/revisions\/1043"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media?parent=1039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/categories?post=1039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/tags?post=1039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}