{"id":10744,"date":"2022-08-16T13:42:59","date_gmt":"2022-08-16T17:42:59","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=10744"},"modified":"2022-08-16T13:42:59","modified_gmt":"2022-08-16T17:42:59","slug":"keeping-data-and-code-in-the-same-file","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=10744","title":{"rendered":"Keeping Data and Code in the Same File"},"content":{"rendered":"<p>John D. Cook has another post in his series on <a href=\"https:\/\/irreal.org\/blog\/?p=10720\">coding in Org-mode<\/a>. The latest emphasizes how <a href=\"https:\/\/www.johndcook.com\/blog\/2022\/08\/15\/org-table-python\/\">you can keep data, code, and documentation in a single (Org) file<\/a>.<\/p>\n<p>There\u2019s nothing new in that idea for most Irreal readers, of course, but there is one new thing I didn\u2019t know. When you use a table as input data for a code block, the header is not part of the data by default. You can get Org-mode to pass the header too by specifying the unintuitive parameter <code>:colnames no<\/code> on the source block line. Cook also gives some Python code that shows how to print the table along with the header and also do some calculations on the data.<\/p>\n<p>Cook is a consulting mathematician and I view this series of posts as him documenting his evolving use of Org-mode in his work. The whole series is worth a look.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>John D. Cook has another post in his series on coding in Org-mode. The latest emphasizes how you can keep data, code, and documentation in a single (Org) file. There\u2019s nothing new in that idea for most Irreal readers, of &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=10744\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18,4],"class_list":["post-10744","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs","tag-org-mode"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10744"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10744\/revisions"}],"predecessor-version":[{"id":10745,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10744\/revisions\/10745"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}