{"id":717,"date":"2016-04-20T15:48:08","date_gmt":"2016-04-20T19:48:08","guid":{"rendered":"https:\/\/www.devolve.net\/blog\/?p=717"},"modified":"2016-04-20T15:48:08","modified_gmt":"2016-04-20T19:48:08","slug":"distribution-histograms-in-the-terminal","status":"publish","type":"post","link":"https:\/\/www.devolve.local\/distribution-histograms-in-the-terminal\/","title":{"rendered":"distribution: histograms in the terminal"},"content":{"rendered":"

My new favorite tool is a python program called distribution<\/code><\/a> that can easily show histograms in your terminal:<\/p>\n

$ cd \/usr\/share\/dict\r\n$ cut -c 1 < words | distribution --char=# --width=60\r\nKey|Ct    (Pct)   Histogram\r\ns|22759 (9.65%) ############################################\r\np|22171 (9.40%) ##########################################\r\nc|17406 (7.38%) #################################\r\nu|16179 (6.86%) ###############################\r\na|14537 (6.16%) ############################\r\nt|11389 (4.83%) ######################\r\nm|10709 (4.54%) #####################\r\nd| 9946 (4.22%) ###################\r\nb| 9675 (4.10%) ###################\r\nr| 8955 (3.80%) #################\r\ni| 8303 (3.52%) ################\r\nh| 7889 (3.34%) ###############\r\ne| 7818 (3.31%) ###############\r\no| 7219 (3.06%) ##############\r\nf| 6382 (2.71%) #############<\/pre>\n

I used homebrew to install it, but you can see some usage examples and a few other tools on this stackoverflow page<\/a>. I eagerly anticipate showing off some histograms to people.<\/p>\n","protected":false},"excerpt":{"rendered":"

My new favorite tool is a python program called distribution that can easily show histograms in your terminal: $ cd \/usr\/share\/dict $ cut -c 1 < words | distribution --char=# --width=60 Key|Ct (Pct) Histogram s|22759 (9.65%) ############################################ p|22171 (9.40%) ########################################## c|17406 (7.38%) ################################# u|16179 (6.86%) ############################### a|14537 (6.16%) ############################ t|11389 (4.83%) ###################### m|10709 (4.54%) ##################### […]\n<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[34,41,23],"_links":{"self":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/717"}],"collection":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/comments?post=717"}],"version-history":[{"count":4,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/717\/revisions"}],"predecessor-version":[{"id":721,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/717\/revisions\/721"}],"wp:attachment":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/media?parent=717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/categories?post=717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/tags?post=717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}