From jep200404 at columbus.rr.com Thu Jan 9 03:36:53 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Wed, 8 Jan 2014 21:36:53 -0500 Subject: [CentralOH] Python Rising: The Rise And Fall of Languages in 2013 Message-ID: <20140108213653.313ef3ef.jep200404@columbus.rr.com> Python rising, Perl falling The article linked reviews the rise and fall of languages in 2013. http://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-2013/240165192 From jdsantiagojr at gmail.com Thu Jan 9 17:56:18 2014 From: jdsantiagojr at gmail.com (John Santiago) Date: Thu, 9 Jan 2014 11:56:18 -0500 Subject: [CentralOH] Code by Voice Message-ID: http://www.i-programmer.info/news/99-professional/6263-code-by-voice-faster-than-keyboard.html -- This electronic message is intended to be for the use only of the named recipient, and may contain information that is confidential or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited. If you have received this message in error or are not the named recipient, please notify us immediately by contacting the sender at the electronic mail address noted above, and delete and destroy all copies of this message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Fri Jan 10 19:21:09 2014 From: eric at intellovations.com (Eric Floehr) Date: Fri, 10 Jan 2014 13:21:09 -0500 Subject: [CentralOH] Python Rising: The Rise And Fall of Languages in 2013 In-Reply-To: <20140108213653.313ef3ef.jep200404@columbus.rr.com> References: <20140108213653.313ef3ef.jep200404@columbus.rr.com> Message-ID: Interesting! Go Python! I know I've been really impressed lately with the number of IPython Notebook based blog posts walking though crunching datasets (like movie body count, three-point shot percentages, etc.). But I was struck by the names of three C/C++/systems programming language replacements. I know that there has been research on baby names and success, I wonder if it holds true to programming languages. For example, knowing that "Rust", "Nimrod", and "Go" occupy nearly the same language-space and nothing else, I lean towards "Go" because of the negative connotations of the other names. I realize my biases are English-language based, and maybe U.S.-based (in the case of the negative connotation of Nimrod). On Wed, Jan 8, 2014 at 9:36 PM, wrote: > Python rising, Perl falling > The article linked reviews the rise and fall of languages in 2013. > > http://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-2013/240165192 > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Fri Jan 10 19:04:29 2014 From: eric at intellovations.com (Eric Floehr) Date: Fri, 10 Jan 2014 13:04:29 -0500 Subject: [CentralOH] Code by Voice In-Reply-To: References: Message-ID: That is really amazing! It's too bad Dragon Naturally Speaking doesn't run on Linux. -Eric On Thu, Jan 9, 2014 at 11:56 AM, John Santiago wrote: > > http://www.i-programmer.info/news/99-professional/6263-code-by-voice-faster-than-keyboard.html > > -- > This electronic message is intended to be for the use only of the named > recipient, and may contain information that is confidential or privileged. > If you are not the intended recipient, you are hereby notified that any > disclosure, copying, distribution or use of the contents of this message is > strictly prohibited. If you have received this message in error or are not > the named recipient, please notify us immediately by contacting the sender > at the electronic mail address noted above, and delete and destroy all > copies of this message. Thank you. > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Sun Jan 12 00:46:18 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 11 Jan 2014 18:46:18 -0500 Subject: [CentralOH] =?utf-8?q?2014-01-10_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= Message-ID: <20140111184618.55a91429.jep200404@columbus.rr.com> did not have reservation for "Community Room", so met out in the open at ordinary tables. "wp:" prefix means Wikipedia. E.g., "wp:foo" indicates http://en.wikipedia.org/wiki/Foo trying to get vicent visualization library working with iPython Notebook https://pypi.python.org/pypi/vincent gnarly dependencies All Your Base Are Belong To Us http://rt.com/usa/ford-vp-retracts-remarks-429/ http://www.thecarconnection.com/news/1089607_fords-jim-farley-apologizes-for-claiming-we-know-what-youre-doing http://www.huffingtonpost.com/2014/01/09/ford-spying-car-jim-farley-ces_n_4569029.html wp:Open Automotive Alliance http://www.openautoalliance.net/ http://blogs.wsj.com/cio/2014/01/06/googles-auto-alliance-paves-way-for-self-driving-cars/ wp:Ixquick wp:DuckDuckGo wp:Wolfram Alpha wp:Ray Kurzweil wp:The Singularity Is Near wp:Julia (programming language) ijulia ijulia notebook https://www.mywickr.com/en/index.php http://www.techdirt.com/articles/20140108/23073325816/what-intelligence-community-doesnt-get-backdoor-good-guys-is-always-backdoor-bad-guys-as-well.shtml Ken Thompson's Reflections on Trusting Trust wp:Backdoor_exploit#Reflections_on_Trusting_Trust wp:Ken Thompson wp:Japan Prize M# programming language proprietary wp:M Sharp (programming language) http://www.msharp.co.uk/Home.html http://venturebeat.com/2013/12/30/microsoft-reportedly-developing-a-programming-language-called-m-and-it-may-be-open-sourced/ http://www.i-programmer.info/news/98-languages/6786-microsofts-new-language-m.html http://www.extremeoptimization.com/MSharp/ #coding-noobs channel on freenode webchat.freenode.net colug.net http://lists.colug.net/mailman/listinfo/colug-432 From jep200404 at columbus.rr.com Sun Jan 12 01:20:23 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 11 Jan 2014 19:20:23 -0500 Subject: [CentralOH] =?utf-8?q?2014-01-03_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= Message-ID: <20140111192023.1e025175.jep200404@columbus.rr.com> The first web browser and Doom were developed under NeXTSTEP, the precursor to OS-X and iOS. Objective C is pretty clean, although like C, often requires much more low-level tedium than Python. "wp:" prefix means Wikipedia. E.g., "wp:foo" indicates http://en.wikipedia.org/wiki/Foo wp:Objective-C wp:Tim Berners-Lee wp:WorldWideWeb wp:NeXT Computer wp:NeXTSTEP wp:OS X wp:Mach (kernel) wp:Doom (video game) Developing iThing apps still has NeXTSTEP stuff in it. There are names that begin with NS for NeXTSTEP. Acetone is a ketone, the simplest ketone. It's name is idiomatic. Many sugars are ketones. wp:ketone http://www.goodreads.com/book/show/60044.Class wp:Paul Fussell http://datasciencemasters.org/ data scientists versus statisticians got donation of books From pybokeh at gmail.com Sat Jan 18 01:13:01 2014 From: pybokeh at gmail.com (pybokeh) Date: Fri, 17 Jan 2014 19:13:01 -0500 Subject: [CentralOH] =?utf-8?q?2014-01-03_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz86IFZpbmNlbnQgUHJvYmxlbQ==?= Message-ID: On Sun Jan 12 00:46:18 CET 2014, jep200404 at columbus.rr.com wrote, > trying to get vicent visualization library working with iPython Notebook > https://pypi.python.org/pypi/vincent > gnarly dependencies I found out why Vincent wasn't working for me. It relies on the D3 javascript which went up a version and broke things with Vincent as per this GitHub issue item: https://github.com/wrobstory/vincent/issues/89 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pybokeh at gmail.com Sat Jan 18 01:18:16 2014 From: pybokeh at gmail.com (pybokeh) Date: Fri, 17 Jan 2014 19:18:16 -0500 Subject: [CentralOH] =?utf-8?q?2014-01-10_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz86IElSQyBDaGFubmVsIEZvciBOb29iaWVz?= Message-ID: On *Sun Jan 12 00:46:18 CET 2014, *jep200404 at columbus.rr.com wrote: > #coding-noobs channel on freenode The IRC channel that I sometime frequent is #coding-n00bs (spelled with zeros, not the letter O), sorry about that. - Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From fandi.814 at gmail.com Sat Jan 18 01:48:27 2014 From: fandi.814 at gmail.com (Fandi Peng) Date: Fri, 17 Jan 2014 19:48:27 -0500 Subject: [CentralOH] =?utf-8?b?IDIwMTQtMDEtMTcg6YGT5aC0IFNjcmliYmxlcyA=?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= Message-ID: >From Elephant Island to Buying a Brown Cow in Friesland wp:Ernest Shackleton wp:Imperial Trans-Antarctic Expedition wp:Voyage of the James Caird wp:sextant wp:lunar distance wp:History of longitude https://github.com/brandon-rhodes/astronomy-notebooks https://github.com/brandon-rhodes/python-skyfield Bulova Accutron Spaceview wp:Marine chronometer wp:Gemma Frisius wp:Friesland wp:Menno Simons wp:West Frisian language https://www.youtube.com/watch?v=OeC1yAaWG34 From jep200404 at columbus.rr.com Mon Jan 20 22:09:56 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 20 Jan 2014 16:09:56 -0500 Subject: [CentralOH] =?utf-8?q?2014-01-17_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= In-Reply-To: References: Message-ID: <20140120160956.2cd88492.jep200404@columbus.rr.com> The most interesting thing[1] was interesting because I should have known it. It used the dictionary get method to count words. counts = {} for word in words_list: counts[word] = counts.get(word, 0) + 1 We had to look it up in Learning Python by Mark Lutz. (p 210 in a printing of 4th edition.) It reminded me of the introductory examples on starting on page 19 of pfda[2]. Someone just passed the CISSP exam, so now can play with Python. If he passed, his employer would pay for it (about $600). If he failed, his employer would not pay for it. It was a four hour multiple choice exam. One gets a pass/fail grade. 70% is passing. One is not told how well one did. http://scott.a16z.com/2014/01/17/success-at-work-failure-at-home/ http://bhorowitz.com/2014/01/02/can-do-vs-cant-do-cultures/ wp:Newton's method need to by my post my euler to github Euler #80 11.7 ms https://github.com/fandi-peng/Project_Euler/raw/master/code/euler80.py someone was messing with vincent 2013-05-09 https://mail.python.org/pipermail/centraloh/2013-May/001670.html wp:Linear algebra wp:Linear programming wp:Weibull distribution Bunnie doing open source hardware wp:Andrew Huang http://www.eetimes.com/author.asp?section_id=69&doc_id=1320638 http://dangerousprototypes.com/2012/08/23/workshop-video-36-beers-in-bunnies-workshop/ http://dangerousprototypes.com/2012/04/19/video-hua-qiang-bei-market-in-shenzhen-china/ http://www.zdnet.com/uks-security-branch-says-ubuntu-most-secure-end-user-os-7000025312/ nbconvert crashes converting .ipynb to html or pdf simple ones work complex ones, such as with Latex, crash ghosts can not be shone in China shall not promote superstitious stuff in China http://172.17.153.149:8000/Word_Count_Example.ipynb counts = dict() for word in words_list: counts[word] = counts.get(word, 0) + 1 wp:Chromium (web browser) wp:SRWare Iron There are towns in China that are built as movie sets to promote the making of movies there. Do the residents become extras? wp:Extra (acting) https://github.com/ipython/ipython/tree/master/examples/notebooks#a-collection-of-notebooks-for-using-ipython-effectively http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/notebooks/Part%204%20-%20Markdown%20Cells.ipynb wp:CISSP CYNIC, n. A blackguard whose faulty vision sees things as they are, not as they ought to be. Hence the custom among the Scythians of plucking out a cynic's eyes to improve his vision. PITH, n. See Dorothy Parker Tallulah Bankhead What do Tata and Ford have in common? The Devil's Dictionary pypy is faster than cpython speed.pypy.org open-source food? http://www.wildfermentation.com/ http://www.npr.org/2012/06/13/154914381/fermentation-when-food-goes-bad-but-stays-good wp:Charles Csuri http://oncampus.osu.edu/v29n18/thisissue_6.html https://duckduckgo.com/html/?q=charles%20csuri%20wosu%20beyond%20boundaries wp:Lava lamp Polymorphism (computer science), the ability in computer programming to present the same interface for differing underlying forms (data types). Operator overloading can be an example of polymorphism. wp:Polymorphism (computer science) wp:Operator overloading Python supports polymorphism On Fri, 17 Jan 2014 19:48:27 -0500, Fandi Peng wrote: > https://github.com/brandon-rhodes/astronomy-notebooks That's a great introduction to (i)python and is getting some maintainance attention, including the addition of a pandas notebook. There are probably more notes and ipython notebooks coming for this dojo. [1] See http://colug.net/python/dojo/20140117/word-count-example-rev2.ipynb [2] Python for Data Analysis by Wes McKinney this book just keeps coming back up http://shop.oreilly.com/product/0636920023784.do http://blog.wesmckinney.com/ From jep200404 at columbus.rr.com Mon Jan 20 23:56:21 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 20 Jan 2014 17:56:21 -0500 Subject: [CentralOH] Removing Punctuation In-Reply-To: <20140120160956.2cd88492.jep200404@columbus.rr.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> Message-ID: <20140120175621.6abc01e6.jep200404@columbus.rr.com> On Mon, 20 Jan 2014 16:09:56 -0500, jep200404 at columbus.rr.com wrote: > [1] See http://colug.net/python/dojo/20140117/word-count-example-rev2.ipynb "for character in bunch_of_words:\n", " if character in string.punctuation:\n", " bunch_of_words = bunch_of_words.replace(character,\"\")\n", can be simplified as .translate(None, string.punctuation) as in http://colug.net/python/dojo/20140117/word-count-example-rev3.ipynb From pybokeh at gmail.com Tue Jan 21 00:17:07 2014 From: pybokeh at gmail.com (pybokeh) Date: Mon, 20 Jan 2014 18:17:07 -0500 Subject: [CentralOH] Removing Punctuation In-Reply-To: <20140120175621.6abc01e6.jep200404@columbus.rr.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> <20140120175621.6abc01e6.jep200404@columbus.rr.com> Message-ID: <52DDAE73.3040003@gmail.com> Nice, didn't know about the str.translate() method. But it is quite clear what my script is doing, whereas, to someone not familiar with translate(), it isn't so obvious. I'll take readability over esoteric Python methods, unless maybe for performance reason, we should use the translate() method? Anyways, thanks for sharing the str.translate() method! BTW, here's the output of doing help(str.translate) if others happen to read this: translate(...) S.translate(table) -> str Return a copy of the string S, where all characters have been mapped through the given translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None. Unmapped characters are left untouched. Characters mapped to None are deleted. Regards, Daniel On 01/20/2014 05:56 PM, jep200404 at columbus.rr.com wrote: > On Mon, 20 Jan 2014 16:09:56 -0500, jep200404 at columbus.rr.com wrote: > >> [1] See http://colug.net/python/dojo/20140117/word-count-example-rev2.ipynb > "for character in bunch_of_words:\n", > " if character in string.punctuation:\n", > " bunch_of_words = bunch_of_words.replace(character,\"\")\n", > > can be simplified as .translate(None, string.punctuation) > > as in http://colug.net/python/dojo/20140117/word-count-example-rev3.ipynb > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh From pybokeh at gmail.com Tue Jan 21 00:47:39 2014 From: pybokeh at gmail.com (pybokeh) Date: Mon, 20 Jan 2014 18:47:39 -0500 Subject: [CentralOH] Removing Punctuation In-Reply-To: <20140120175621.6abc01e6.jep200404@columbus.rr.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> <20140120175621.6abc01e6.jep200404@columbus.rr.com> Message-ID: <52DDB59B.7070708@gmail.com> Wow, I just realized there is a difference in str.translate() method between Python 2 and Python 3. I'm currently a Python 3 user and str.translate(string.punctuation) does not work for me (NOTE-str.translate() takes only 1 argument in Python 3). So when I execute str.translate(string.punctuation), it does not get rid of the punctuation marks since it no longer knows to map or delete the punctuation marks. Hmm, now I wonder how do I use the str.translate() method in Python 3 to get rid of the punctuation marks? On 01/20/2014 05:56 PM, jep200404 at columbus.rr.com wrote: > On Mon, 20 Jan 2014 16:09:56 -0500, jep200404 at columbus.rr.com wrote: > >> [1] See http://colug.net/python/dojo/20140117/word-count-example-rev2.ipynb > "for character in bunch_of_words:\n", > " if character in string.punctuation:\n", > " bunch_of_words = bunch_of_words.replace(character,\"\")\n", > > can be simplified as .translate(None, string.punctuation) > > as in http://colug.net/python/dojo/20140117/word-count-example-rev3.ipynb > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh From iynaix at gmail.com Tue Jan 21 00:59:33 2014 From: iynaix at gmail.com (iynaix) Date: Tue, 21 Jan 2014 07:59:33 +0800 Subject: [CentralOH] =?utf-8?q?2014-01-17_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= In-Reply-To: <20140120160956.2cd88492.jep200404@columbus.rr.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> Message-ID: Quick aside: If you're on Python 2.7 and above, you can do the following: from collections import Counter counts = Counter(words_list) Counter is a dictionary-like object that has nice utilities such as being able to add or subtract counters from one another, and most_common(), which is very useful. See the link below for the official docs: http://docs.python.org/2/library/collections.html#collections.Counter Cheers, XY On Tue, Jan 21, 2014 at 5:09 AM, wrote: > The most interesting thing[1] was interesting because I should have known > it. > It used the dictionary get method to count words. > > counts = {} > for word in words_list: > counts[word] = counts.get(word, 0) + 1 > > We had to look it up in Learning Python by Mark Lutz. > (p 210 in a printing of 4th edition.) > > It reminded me of the introductory examples on starting on page 19 of > pfda[2]. > > Someone just passed the CISSP exam, so now can play with Python. > If he passed, his employer would pay for it (about $600). > If he failed, his employer would not pay for it. > It was a four hour multiple choice exam. > One gets a pass/fail grade. 70% is passing. > One is not told how well one did. > > http://scott.a16z.com/2014/01/17/success-at-work-failure-at-home/ > http://bhorowitz.com/2014/01/02/can-do-vs-cant-do-cultures/ > > wp:Newton's method > need to by my post my euler to github Euler #80 11.7 ms > https://github.com/fandi-peng/Project_Euler/raw/master/code/euler80.py > > someone was messing with vincent 2013-05-09 > https://mail.python.org/pipermail/centraloh/2013-May/001670.html > > wp:Linear algebra > wp:Linear programming > > wp:Weibull distribution > > Bunnie doing open source hardware > wp:Andrew Huang > http://www.eetimes.com/author.asp?section_id=69&doc_id=1320638 > > http://dangerousprototypes.com/2012/08/23/workshop-video-36-beers-in-bunnies-workshop/ > > http://dangerousprototypes.com/2012/04/19/video-hua-qiang-bei-market-in-shenzhen-china/ > > > http://www.zdnet.com/uks-security-branch-says-ubuntu-most-secure-end-user-os-7000025312/ > > nbconvert crashes converting .ipynb to html or pdf > simple ones work > complex ones, such as with Latex, crash > > ghosts can not be shone in China > shall not promote superstitious stuff in China > > http://172.17.153.149:8000/Word_Count_Example.ipynb > counts = dict() > for word in words_list: > counts[word] = counts.get(word, 0) + 1 > > wp:Chromium (web browser) > wp:SRWare Iron > > There are towns in China that are built as movie sets to promote the > making of > movies there. Do the residents become extras? > wp:Extra (acting) > > > https://github.com/ipython/ipython/tree/master/examples/notebooks#a-collection-of-notebooks-for-using-ipython-effectively > > http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/notebooks/Part%204%20-%20Markdown%20Cells.ipynb > > wp:CISSP > > CYNIC, n. A blackguard whose faulty vision sees things as they are, not as > they > ought to be. Hence the custom among the Scythians of plucking out a cynic's > eyes to improve his vision. > > PITH, n. See Dorothy Parker > Tallulah Bankhead > What do Tata and Ford have in common? > > The Devil's Dictionary > > pypy is faster than cpython > speed.pypy.org > > open-source food? > http://www.wildfermentation.com/ > > http://www.npr.org/2012/06/13/154914381/fermentation-when-food-goes-bad-but-stays-good > > wp:Charles Csuri > http://oncampus.osu.edu/v29n18/thisissue_6.html > https://duckduckgo.com/html/?q=charles%20csuri%20wosu%20beyond%20boundaries > wp:Lava lamp > > Polymorphism (computer science), the ability in computer programming to > present > the same interface for differing underlying forms (data types). > Operator overloading can be an example of polymorphism. > wp:Polymorphism (computer science) > wp:Operator overloading > Python supports polymorphism > > On Fri, 17 Jan 2014 19:48:27 -0500, Fandi Peng > wrote: > > > https://github.com/brandon-rhodes/astronomy-notebooks > > That's a great introduction to (i)python and is getting some maintainance > attention, including the addition of a pandas notebook. > > There are probably more notes and ipython notebooks coming for > this dojo. > > [1] See > http://colug.net/python/dojo/20140117/word-count-example-rev2.ipynb > > [2] Python for Data Analysis by Wes McKinney > this book just keeps coming back up > http://shop.oreilly.com/product/0636920023784.do > http://blog.wesmckinney.com/ > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Tue Jan 21 01:36:02 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 20 Jan 2014 19:36:02 -0500 Subject: [CentralOH] Removing Punctuation with str.translate() in Python 3 In-Reply-To: <52DDB59B.7070708@gmail.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> <20140120175621.6abc01e6.jep200404@columbus.rr.com> <52DDB59B.7070708@gmail.com> Message-ID: <20140120193602.1ca42177.jep200404@columbus.rr.com> On Mon, 20 Jan 2014 18:47:39 -0500, pybokeh wrote: > ... now I wonder how do I use the str.translate() method in > Python 3 to get rid of the punctuation marks? Careful reading[1] suggests an answer. Use str.maketrans() and str.translate(). Use the third argument of maketrans to create a translation table to convert punctuation to None. str.translate() converts punctuation to None, and deletes them. [1] http://docs.python.org/3/library/stdtypes.html#str.translate http://docs.python.org/3/library/stdtypes.html#str.maketrans From eric at intellovations.com Tue Jan 21 01:20:07 2014 From: eric at intellovations.com (Eric Floehr) Date: Mon, 20 Jan 2014 19:20:07 -0500 Subject: [CentralOH] Removing Punctuation In-Reply-To: <52DDB59B.7070708@gmail.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> <20140120175621.6abc01e6.jep200404@columbus.rr.com> <52DDB59B.7070708@gmail.com> Message-ID: > > Hmm, now I wonder how do I use the str.translate() method in Python 3 to > get rid of the > punctuation marks? >>> import string >>> S = "Some, string! With punctuation." >>> S.translate(S.maketrans("", "", string.punctuation)) 'Some string With punctuation' http://docs.python.org/3/library/stdtypes.html#str.maketrans -------------- next part -------------- An HTML attachment was scrubbed... URL: From pybokeh at gmail.com Tue Jan 21 02:43:20 2014 From: pybokeh at gmail.com (pybokeh) Date: Mon, 20 Jan 2014 20:43:20 -0500 Subject: [CentralOH] Removing Punctuation with str.translate() in Python 3 In-Reply-To: <20140120193602.1ca42177.jep200404@columbus.rr.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> <20140120175621.6abc01e6.jep200404@columbus.rr.com> <52DDB59B.7070708@gmail.com> <20140120193602.1ca42177.jep200404@columbus.rr.com> Message-ID: <52DDD0B8.8060903@gmail.com> Oh wow, this makes readability or clarity worse in my opinion. Surely there is a performance gain from using translate()/maketrans() combination? Maybe profiling a Python program can be a topic for discussion at the next Python dojo meeting :-) On 01/20/2014 07:36 PM, jep200404 at columbus.rr.com wrote: > On Mon, 20 Jan 2014 18:47:39 -0500, pybokeh wrote: > >> ... now I wonder how do I use the str.translate() method in >> Python 3 to get rid of the punctuation marks? > Careful reading[1] suggests an answer. > Use str.maketrans() and str.translate(). > Use the third argument of maketrans to create a > translation table to convert punctuation to None. > str.translate() converts punctuation to None, and deletes them. > > [1] http://docs.python.org/3/library/stdtypes.html#str.translate > http://docs.python.org/3/library/stdtypes.html#str.maketrans > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh From pybokeh at gmail.com Tue Jan 21 03:24:50 2014 From: pybokeh at gmail.com (pybokeh) Date: Mon, 20 Jan 2014 21:24:50 -0500 Subject: [CentralOH] Removing Punctuation In-Reply-To: References: <20140120160956.2cd88492.jep200404@columbus.rr.com> <20140120175621.6abc01e6.jep200404@columbus.rr.com> <52DDB59B.7070708@gmail.com> Message-ID: <52DDDA72.7000508@gmail.com> Thanks for this. I thought I could replace a punctuation mark with a single white space by doing this: S.translate(S.maketrans(" ", " ", string.punctuation)) But that didn't work. Any ideas how to replace a punctuation mark with a single white space? The reason being, what if there is no space after a punctuation mark or three periods were used: "Mary had a little lamb...little lamb...little lamb! Do you know what Mary's problem is?No I do not!" Then "isNo" ends up being counted as a word and also "lamblittle", so I want to prevent this by replacing a punctuation mark with a singe white space instead of no white space. On 01/20/2014 07:20 PM, Eric Floehr wrote: > > Hmm, now I wonder how do I use the str.translate() method in > Python 3 to get rid of the > punctuation marks? > > > > >>> import string > >>> S = "Some, string! With punctuation." > >>> S.translate(S.maketrans("", "", string.punctuation)) > 'Some string With punctuation' > > http://docs.python.org/3/library/stdtypes.html#str.maketrans > > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Tue Jan 21 04:20:01 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 20 Jan 2014 22:20:01 -0500 Subject: [CentralOH] Profiling In-Reply-To: <52DDD0B8.8060903@gmail.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> <20140120175621.6abc01e6.jep200404@columbus.rr.com> <52DDB59B.7070708@gmail.com> <20140120193602.1ca42177.jep200404@columbus.rr.com> <52DDD0B8.8060903@gmail.com> Message-ID: <20140120222001.18f2b72b.jep200404@columbus.rr.com> On Mon, 20 Jan 2014 20:43:20 -0500, pybokeh wrote: > Maybe profiling a Python program can be a topic for discussion > at the next Python dojo meeting :-) %timeit in ipython http://pynash.org/2013/03/06/timing-and-profiling.html An example is in An-Introduction--Notebook-Features.ipynb in Brandon's celestial tour through ipython notebook. https://github.com/brandon-rhodes/astronomy-notebooks/blob/master/An-Introduction--Notebook-Features.ipynb Instructions for Python 2.7 on Xubuntu 12.10 https://mail.python.org/pipermail/centraloh/2013-February/001551.html Bleeding edge for Python 2.7 on xubuntu 12.10 https://github.com/james-prior/astronomy-notebooks/blob/jep-dev/INSTALL-xubuntu-12.10 https://github.com/james-prior/astronomy-notebooks/tree/jep-dev From jep200404 at columbus.rr.com Tue Jan 21 04:23:17 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 20 Jan 2014 22:23:17 -0500 Subject: [CentralOH] Removing Punctuation: Replace Punctuation With Spaces In-Reply-To: <52DDDA72.7000508@gmail.com> References: <20140120160956.2cd88492.jep200404@columbus.rr.com> <20140120175621.6abc01e6.jep200404@columbus.rr.com> <52DDB59B.7070708@gmail.com> <52DDDA72.7000508@gmail.com> Message-ID: <20140120222317.0798effe.jep200404@columbus.rr.com> On Mon, 20 Jan 2014 21:24:50 -0500, pybokeh wrote: > I thought I could replace a punctuation mark with a single white space > by doing this: > S.translate(S.maketrans(" ", " ", string.punctuation)) > > But that didn't work. Any ideas how to replace a punctuation mark with > a single white space? Here's an untested ugly idea: S.translate( S.maketrans(string.punctuation, " " * len(string.punctuation)) From jcfolsom at pureperfect.com Tue Jan 21 06:51:41 2014 From: jcfolsom at pureperfect.com (Chris Folsom) Date: Mon, 20 Jan 2014 22:51:41 -0700 Subject: [CentralOH] Removing Punctuation: Replace Punctuation With Spaces Message-ID: <20140120225141.7098ff60d8000ac98b0356cd27c73871.fd7201326c.wbe@email04.secureserver.net> An HTML attachment was scrubbed... URL: From eric at intellovations.com Tue Jan 21 13:02:56 2014 From: eric at intellovations.com (Eric Floehr) Date: Tue, 21 Jan 2014 07:02:56 -0500 Subject: [CentralOH] Removing Punctuation: Replace Punctuation With Spaces In-Reply-To: <20140120225141.7098ff60d8000ac98b0356cd27c73871.fd7201326c.wbe@email04.secureserver.net> References: <20140120225141.7098ff60d8000ac98b0356cd27c73871.fd7201326c.wbe@email04.secureserver.net> Message-ID: In other words (works in Python 2 and Python 3): >>> import re >>> import string >>> punctuation_re = re.compile('[' + string.punctuation + ']') >>> S = "Some, string! With punctuation." >>> punctuation_re.sub(' ', S) 'Some string With punctuation ' On Tue, Jan 21, 2014 at 12:51 AM, Chris Folsom wrote: > > ? > > http://docs.python.org/2/howto/regex.html#search-and-replace > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcfolsom at pureperfect.com Tue Jan 21 16:12:30 2014 From: jcfolsom at pureperfect.com (Chris Folsom) Date: Tue, 21 Jan 2014 08:12:30 -0700 Subject: [CentralOH] Removing Punctuation: Replace Punctuation With Spaces Message-ID: <20140121081230.7098ff60d8000ac98b0356cd27c73871.055d02a058.wbe@email04.secureserver.net> An HTML attachment was scrubbed... URL: From erik.n.welch at gmail.com Tue Jan 21 18:38:38 2014 From: erik.n.welch at gmail.com (Erik Welch) Date: Tue, 21 Jan 2014 12:38:38 -0500 Subject: [CentralOH] =?utf-8?q?2014-01-17_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= In-Reply-To: References: <20140120160956.2cd88492.jep200404@columbus.rr.com> Message-ID: I have a few comments on the word counting example. First, it is possible to view the referenced iPython notebooks online from http://nbviewer.ipython.org/ . See the notebook here: http://nbviewer.ipython.org/url/colug.net/python/dojo/20140117/word-count-example-rev2.ipynb?create=1 Second, there have been somewhat recent blog posts using word counting as an example. The first compares a verbose solution with simple terms to concise solutions with complex terms: http://matthewrocklin.com/blog/work/2013/11/15/Functional-Wordcount/ A newer blog post looks at the performance of Python and other languages for a specific text processing task: http://matthewrocklin.com/blog/work/2014/01/13/Text-Benchmarks/ Finally, to learn more about functional data analysis in Python, here is a video tutorial from the same author as the above posts (and it uses the `toolz` library, although the talk isn't strictly about `toolz`): http://vimeo.com/80096814 Cheers, Erik On Mon, Jan 20, 2014 at 6:59 PM, iynaix wrote: > Quick aside: > > If you're on Python 2.7 and above, you can do the following: > > from collections import Counter > counts = Counter(words_list) > > Counter is a dictionary-like object that has nice utilities such as being > able to add or subtract counters from one another, and most_common(), which > is very useful. See the link below for the official docs: > > http://docs.python.org/2/library/collections.html#collections.Counter > > Cheers, > XY > > > On Tue, Jan 21, 2014 at 5:09 AM, wrote: > >> The most interesting thing[1] was interesting because I should have known >> it. >> It used the dictionary get method to count words. >> >> counts = {} >> for word in words_list: >> counts[word] = counts.get(word, 0) + 1 >> >> We had to look it up in Learning Python by Mark Lutz. >> (p 210 in a printing of 4th edition.) >> >> It reminded me of the introductory examples on starting on page 19 of >> pfda[2]. >> >> Someone just passed the CISSP exam, so now can play with Python. >> If he passed, his employer would pay for it (about $600). >> If he failed, his employer would not pay for it. >> It was a four hour multiple choice exam. >> One gets a pass/fail grade. 70% is passing. >> One is not told how well one did. >> >> http://scott.a16z.com/2014/01/17/success-at-work-failure-at-home/ >> http://bhorowitz.com/2014/01/02/can-do-vs-cant-do-cultures/ >> >> wp:Newton's method >> need to by my post my euler to github Euler #80 11.7 ms >> https://github.com/fandi-peng/Project_Euler/raw/master/code/euler80.py >> >> someone was messing with vincent 2013-05-09 >> https://mail.python.org/pipermail/centraloh/2013-May/001670.html >> >> wp:Linear algebra >> wp:Linear programming >> >> wp:Weibull distribution >> >> Bunnie doing open source hardware >> wp:Andrew Huang >> http://www.eetimes.com/author.asp?section_id=69&doc_id=1320638 >> >> http://dangerousprototypes.com/2012/08/23/workshop-video-36-beers-in-bunnies-workshop/ >> >> http://dangerousprototypes.com/2012/04/19/video-hua-qiang-bei-market-in-shenzhen-china/ >> >> >> http://www.zdnet.com/uks-security-branch-says-ubuntu-most-secure-end-user-os-7000025312/ >> >> nbconvert crashes converting .ipynb to html or pdf >> simple ones work >> complex ones, such as with Latex, crash >> >> ghosts can not be shone in China >> shall not promote superstitious stuff in China >> >> http://172.17.153.149:8000/Word_Count_Example.ipynb >> counts = dict() >> for word in words_list: >> counts[word] = counts.get(word, 0) + 1 >> >> wp:Chromium (web browser) >> wp:SRWare Iron >> >> There are towns in China that are built as movie sets to promote the >> making of >> movies there. Do the residents become extras? >> wp:Extra (acting) >> >> >> https://github.com/ipython/ipython/tree/master/examples/notebooks#a-collection-of-notebooks-for-using-ipython-effectively >> >> http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/notebooks/Part%204%20-%20Markdown%20Cells.ipynb >> >> wp:CISSP >> >> CYNIC, n. A blackguard whose faulty vision sees things as they are, not >> as they >> ought to be. Hence the custom among the Scythians of plucking out a >> cynic's >> eyes to improve his vision. >> >> PITH, n. See Dorothy Parker >> Tallulah Bankhead >> What do Tata and Ford have in common? >> >> The Devil's Dictionary >> >> pypy is faster than cpython >> speed.pypy.org >> >> open-source food? >> http://www.wildfermentation.com/ >> >> http://www.npr.org/2012/06/13/154914381/fermentation-when-food-goes-bad-but-stays-good >> >> wp:Charles Csuri >> http://oncampus.osu.edu/v29n18/thisissue_6.html >> >> https://duckduckgo.com/html/?q=charles%20csuri%20wosu%20beyond%20boundaries >> wp:Lava lamp >> >> Polymorphism (computer science), the ability in computer programming to >> present >> the same interface for differing underlying forms (data types). >> Operator overloading can be an example of polymorphism. >> wp:Polymorphism (computer science) >> wp:Operator overloading >> Python supports polymorphism >> >> On Fri, 17 Jan 2014 19:48:27 -0500, Fandi Peng >> wrote: >> >> > https://github.com/brandon-rhodes/astronomy-notebooks >> >> That's a great introduction to (i)python and is getting some maintainance >> attention, including the addition of a pandas notebook. >> >> There are probably more notes and ipython notebooks coming for >> this dojo. >> >> [1] See >> http://colug.net/python/dojo/20140117/word-count-example-rev2.ipynb >> >> [2] Python for Data Analysis by Wes McKinney >> this book just keeps coming back up >> http://shop.oreilly.com/product/0636920023784.do >> http://blog.wesmckinney.com/ >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcfolsom at pureperfect.com Tue Jan 21 19:22:22 2014 From: jcfolsom at pureperfect.com (Chris Folsom) Date: Tue, 21 Jan 2014 11:22:22 -0700 Subject: [CentralOH] =?utf-8?b?MjAxNC0wMS0xN1/pgZPloLRfU2NyaWJibGVzXyA=?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= Message-ID: <20140121112222.7098ff60d8000ac98b0356cd27c73871.d9424af63b.wbe@email04.secureserver.net> An HTML attachment was scrubbed... URL: From jcfolsom at pureperfect.com Tue Jan 21 19:37:18 2014 From: jcfolsom at pureperfect.com (Chris Folsom) Date: Tue, 21 Jan 2014 11:37:18 -0700 Subject: [CentralOH] 10 Reasons to Learn and Use Regular Expressions (From Flagrant Badassery) Message-ID: <20140121113718.7098ff60d8000ac98b0356cd27c73871.910517aad5.wbe@email04.secureserver.net> An HTML attachment was scrubbed... URL: From erik.n.welch at gmail.com Tue Jan 21 20:11:41 2014 From: erik.n.welch at gmail.com (Erik Welch) Date: Tue, 21 Jan 2014 14:11:41 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0wMS0xN1/pgZPloLRfU2NyaWJibGVzXyA=?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= In-Reply-To: <20140121112222.7098ff60d8000ac98b0356cd27c73871.d9424af63b.wbe@email04.secureserver.net> References: <20140121112222.7098ff60d8000ac98b0356cd27c73871.d9424af63b.wbe@email04.secureserver.net> Message-ID: On Tue, Jan 21, 2014 at 1:22 PM, Chris Folsom wrote: > > If you have more than one line of code, you're probably doing it wrong. Many people have learned to be more modest by avoiding statements like this. You never know for certain when you may be wrong. In this case, you misunderstood the problem being considered and what the final outcome is supposed to be. It is not simply counting the number of words, the goal is to count the number of occurrences of each word. There are more nuances to this than you might initially expect. There are also many different approaches, and each has its own merits. In general, there often isn't a single optimal solution, because "optimal" can mean many different things, and optimality can also be different in different contexts. Anyway, thanks for sharing the regex example! p.s. I tried to run your code in Python to count the total number of words in a string. It gave me an incorrect answer. On Tue, Jan 21, 2014 at 1:22 PM, Chris Folsom wrote: > > If it's for word counting. You're over complicating it. In language > neutral pseudo-code: > > var myString = "blah.blah?blah! blah blah" > > var regExpForWhiteSpaceAndPunctuation = "(\.|\;|\:|\!|\?|\s)*" > > var[] wordsInMyString = myString.split(regExpForWhiteSpaceAndPunctuation) > > println "Word count: " + wordsInMyString.length > > or alternatively: > > "some random string".split("(\.|\;|\:|\!|\?|\s)*").length > > That ought to be the optimal solution in any language. No substitution or > additional string creation is necessary. The python equivalent is > re.split(*pattern*, *string*, *maxsplit=0*, *flags=0*) > So > > len(re.split(regExpForWhitespaceAndPunctuation, myString)) > > > If you have more than one line of code, you're probably doing it wrong. > > -------- Original Message -------- > Subject: Re: [CentralOH] 2014-01-17_??_Scribbles_ ??/??? > Much more > From: Erik Welch > Date: Tue, January 21, 2014 12:38 pm > To: "Mailing list for Central Ohio Python User Group (COhPy)" > > > I have a few comments on the word counting example. First, it is possible > to view the referenced iPython notebooks online from > http://nbviewer.ipython.org/ . See the notebook here: > > > http://nbviewer.ipython.org/url/colug.net/python/dojo/20140117/word-count-example-rev2.ipynb?create=1 > > Second, there have been somewhat recent blog posts using word counting as > an example. The first compares a verbose solution with simple terms to > concise solutions with complex terms: > > http://matthewrocklin.com/blog/work/2013/11/15/Functional-Wordcount/ > > A newer blog post looks at the performance of Python and other languages > for a specific text processing task: > > http://matthewrocklin.com/blog/work/2014/01/13/Text-Benchmarks/ > > Finally, to learn more about functional data analysis in Python, here is a > video tutorial from the same author as the above posts (and it uses the > `toolz` library, although the talk isn't strictly about `toolz`): > > http://vimeo.com/80096814 > > Cheers, > Erik > > > On Mon, Jan 20, 2014 at 6:59 PM, iynaix wrote: > >> Quick aside: >> >> If you're on Python 2.7 and above, you can do the following: >> >> from collections import Counter >> counts = Counter(words_list) >> >> Counter is a dictionary-like object that has nice utilities such as being >> able to add or subtract counters from one another, and most_common(), which >> is very useful. See the link below for the official docs: >> >> http://docs.python.org/2/library/collections.html#collections.Counter >> >> Cheers, >> XY >> >> >> On Tue, Jan 21, 2014 at 5:09 AM, wrote: >> >>> The most interesting thing[1] was interesting because I should have >>> known it. >>> It used the dictionary get method to count words. >>> >>> counts = {} >>> for word in words_list: >>> counts[word] = counts.get(word, 0) + 1 >>> >>> We had to look it up in Learning Python by Mark Lutz. >>> (p 210 in a printing of 4th edition.) >>> >>> It reminded me of the introductory examples on starting on page 19 of >>> pfda[2]. >>> >>> Someone just passed the CISSP exam, so now can play with Python. >>> If he passed, his employer would pay for it (about $600). >>> If he failed, his employer would not pay for it. >>> It was a four hour multiple choice exam. >>> One gets a pass/fail grade. 70% is passing. >>> One is not told how well one did. >>> >>> http://scott.a16z.com/2014/01/17/success-at-work-failure-at-home/ >>> http://bhorowitz.com/2014/01/02/can-do-vs-cant-do-cultures/ >>> >>> wp:Newton's method >>> need to by my post my euler to github Euler #80 11.7 ms >>> https://github.com/fandi-peng/Project_Euler/raw/master/code/euler80.py >>> >>> someone was messing with vincent 2013-05-09 >>> https://mail.python.org/pipermail/centraloh/2013-May/001670.html >>> >>> wp:Linear algebra >>> wp:Linear programming >>> >>> wp:Weibull distribution >>> >>> Bunnie doing open source hardware >>> wp:Andrew Huang >>> http://www.eetimes.com/author.asp?section_id=69&doc_id=1320638 >>> >>> http://dangerousprototypes.com/2012/08/23/workshop-video-36-beers-in-bunnies-workshop/ >>> >>> http://dangerousprototypes.com/2012/04/19/video-hua-qiang-bei-market-in-shenzhen-china/ >>> >>> >>> http://www.zdnet.com/uks-security-branch-says-ubuntu-most-secure-end-user-os-7000025312/ >>> >>> nbconvert crashes converting .ipynb to html or pdf >>> simple ones work >>> complex ones, such as with Latex, crash >>> >>> ghosts can not be shone in China >>> shall not promote superstitious stuff in China >>> >>> http://172.17.153.149:8000/Word_Count_Example.ipynb >>> counts = dict() >>> for word in words_list: >>> counts[word] = counts.get(word, 0) + 1 >>> >>> wp:Chromium (web browser) >>> wp:SRWare Iron >>> >>> There are towns in China that are built as movie sets to promote the >>> making of >>> movies there. Do the residents become extras? >>> wp:Extra (acting) >>> >>> >>> https://github.com/ipython/ipython/tree/master/examples/notebooks#a-collection-of-notebooks-for-using-ipython-effectively >>> >>> http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/notebooks/Part%204%20-%20Markdown%20Cells.ipynb >>> >>> wp:CISSP >>> >>> CYNIC, n. A blackguard whose faulty vision sees things as they are, not >>> as they >>> ought to be. Hence the custom among the Scythians of plucking out a >>> cynic's >>> eyes to improve his vision. >>> >>> PITH, n. See Dorothy Parker >>> Tallulah Bankhead >>> What do Tata and Ford have in common? >>> >>> The Devil's Dictionary >>> >>> pypy is faster than cpython >>> speed.pypy.org >>> >>> open-source food? >>> http://www.wildfermentation.com/ >>> >>> http://www.npr.org/2012/06/13/154914381/fermentation-when-food-goes-bad-but-stays-good >>> >>> wp:Charles Csuri >>> http://oncampus.osu.edu/v29n18/thisissue_6.html >>> >>> https://duckduckgo.com/html/?q=charles%20csuri%20wosu%20beyond%20boundaries >>> wp:Lava lamp >>> >>> Polymorphism (computer science), the ability in computer programming to >>> present >>> the same interface for differing underlying forms (data types). >>> Operator overloading can be an example of polymorphism. >>> wp:Polymorphism (computer science) >>> wp:Operator overloading >>> Python supports polymorphism >>> >>> On Fri, 17 Jan 2014 19:48:27 -0500, Fandi Peng >>> wrote: >>> >>> > https://github.com/brandon-rhodes/astronomy-notebooks >>> >>> That's a great introduction to (i)python and is getting some maintainance >>> attention, including the addition of a pandas notebook. >>> >>> There are probably more notes and ipython notebooks coming for >>> this dojo. >>> >>> [1] See >>> http://colug.net/python/dojo/20140117/word-count-example-rev2.ipynb >>> >>> [2] Python for Data Analysis by Wes McKinney >>> this book just keeps coming back up >>> http://shop.oreilly.com/product/0636920023784.do >>> http://blog.wesmckinney.com/ >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > ------------------------------ > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centralo > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at yanovich.net Tue Jan 21 20:02:45 2014 From: michael at yanovich.net (michael at yanovich.net) Date: Tue, 21 Jan 2014 14:02:45 -0500 Subject: [CentralOH] 10 Reasons to Learn and Use Regular Expressions (From Flagrant Badassery) In-Reply-To: <20140121113718.7098ff60d8000ac98b0356cd27c73871.910517aad5.wbe@email04.secureserver.net> References: <20140121113718.7098ff60d8000ac98b0356cd27c73871.910517aad5.wbe@email04.secureserver.net> Message-ID: <52DEC455.2090408@yanovich.net> On 01/21/2014 01:37 PM, Chris Folsom wrote: > > http://blog.stevenlevithan.com/archives/10-reasons-to-learn-and-use-regular-expressions > > #11 Because someday you might want to write useful shell scripts. > > #12 Because they look like sparkles and magic to people with pointy hair. > > This is a nifty way to practice regular expressions, http://regex.alf.nu/ cf. https://xkcd.com/1313/ -- Michael Yanovich -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 901 bytes Desc: OpenPGP digital signature URL: From eric at intellovations.com Tue Jan 21 20:13:29 2014 From: eric at intellovations.com (Eric Floehr) Date: Tue, 21 Jan 2014 14:13:29 -0500 Subject: [CentralOH] 10 Reasons to Learn and Use Regular Expressions (From Flagrant Badassery) In-Reply-To: <20140121113718.7098ff60d8000ac98b0356cd27c73871.910517aad5.wbe@email04.secureserver.net> References: <20140121113718.7098ff60d8000ac98b0356cd27c73871.910517aad5.wbe@email04.secureserver.net> Message-ID: Related, I was filling out a web form and entered my phone number as a sequence of 10 digits, ala: 6145551212 It returned with an error saying I must enter my phone number in the form "###-###-####". Are you serious? In this day and age, there is no excuse for that. That's what computers are GOOD at. If you'd like to stretch your regex muscle, build a regex that allows for any number of phone number formats, including optional 1. Of course you could also Google it :-). On Tue, Jan 21, 2014 at 1:37 PM, Chris Folsom wrote: > > > http://blog.stevenlevithan.com/archives/10-reasons-to-learn-and-use-regular-expressions > > #11 Because someday you might want to write useful shell scripts. > > #12 Because they look like sparkles and magic to people with pointy hair. > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From herrold at owlriver.com Tue Jan 21 20:08:43 2014 From: herrold at owlriver.com (R P Herrold) Date: Tue, 21 Jan 2014 14:08:43 -0500 (EST) Subject: [CentralOH] 10 Reasons to Learn and Use Regular Expressions (From Flagrant Badassery) In-Reply-To: <20140121113718.7098ff60d8000ac98b0356cd27c73871.910517aad5.wbe@email04.secureserver.net> References: <20140121113718.7098ff60d8000ac98b0356cd27c73871.910517aad5.wbe@email04.secureserver.net> Message-ID: On Tue, 21 Jan 2014, Chris Folsom wrote: > #12 Because they look like sparkles and magic to people with pointy hair. # 13 -- ' ... added a Regex layer to my project: Now it has N + 1 problems' [1, restated] -- Russ herrold [1] http://regex.info/blog/2006-09-15/247 From jcfolsom at pureperfect.com Tue Jan 21 21:05:34 2014 From: jcfolsom at pureperfect.com (Chris Folsom) Date: Tue, 21 Jan 2014 13:05:34 -0700 Subject: [CentralOH] =?utf-8?b?MjAxNC0wMS0xN1/pgZPloLRfU2NyaWJibGVzXyA=?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= Message-ID: <20140121130534.7098ff60d8000ac98b0356cd27c73871.c61390c634.wbe@email04.secureserver.net> An HTML attachment was scrubbed... URL: From eric at intellovations.com Tue Jan 21 21:29:16 2014 From: eric at intellovations.com (Eric Floehr) Date: Tue, 21 Jan 2014 15:29:16 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0wMS0xN1/pgZPloLRfU2NyaWJibGVzXyA=?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= In-Reply-To: <20140121130534.7098ff60d8000ac98b0356cd27c73871.c61390c634.wbe@email04.secureserver.net> References: <20140121130534.7098ff60d8000ac98b0356cd27c73871.c61390c634.wbe@email04.secureserver.net> Message-ID: > > re.split("(\s|\.|\!|\?)+", "Blah. Blah!Blah! Blah Blah?Blah") > > Results in: > > ['Blah', ' ', 'Blah', '!', 'Blah', ' ', 'Blah', ' ', 'Blah', '?', 'Blah'] > > Where as in Java: > > "Blah. Blah!Blah! Blah Blah?Blah".split("(\\s|\\.|\\!|\\?)+") > > Results in: > > [Blah,Blah,Blah,Blah,Blah,Blah] > > > Don't blame me. I didn't break it. > Parens are a "capturing group" versus brackets which are a "character class". Python's split will "capture" matched groups in the split, whereas Java doesn't. In other contexts, using parens indicates to the regex engine you'd like to keep the match to refer to it later. Perhaps Python's implementation is less broken in that regard. To be correct in both Java and Python, this regex should be using brackets. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcfolsom at pureperfect.com Tue Jan 21 22:14:06 2014 From: jcfolsom at pureperfect.com (Chris Folsom) Date: Tue, 21 Jan 2014 14:14:06 -0700 Subject: [CentralOH] =?utf-8?b?MjAxNC0wMS0xN1/pgZPloLRfU2NyaWJibGVzXyA=?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= Message-ID: <20140121141406.7098ff60d8000ac98b0356cd27c73871.71ba3c6381.wbe@email04.secureserver.net> An HTML attachment was scrubbed... URL: From jdsantiagojr at gmail.com Tue Jan 21 23:59:15 2014 From: jdsantiagojr at gmail.com (John Santiago Jr) Date: Tue, 21 Jan 2014 17:59:15 -0500 Subject: [CentralOH] =?utf-8?q?2014-01-17_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gTXVjaCBtb3Jl?= In-Reply-To: References: <20140120160956.2cd88492.jep200404@columbus.rr.com> Message-ID: <3D35128F-7839-48A7-822C-25A779756745@gmail.com> Very cool. I did not know about the tools lib. Thank you! Sent from my iPhone > On Jan 21, 2014, at 12:38 PM, Erik Welch wrote: > > I have a few comments on the word counting example. First, it is possible to view the referenced iPython notebooks online from http://nbviewer.ipython.org/ . See the notebook here: > > http://nbviewer.ipython.org/url/colug.net/python/dojo/20140117/word-count-example-rev2.ipynb?create=1 > > Second, there have been somewhat recent blog posts using word counting as an example. The first compares a verbose solution with simple terms to concise solutions with complex terms: > > http://matthewrocklin.com/blog/work/2013/11/15/Functional-Wordcount/ > > A newer blog post looks at the performance of Python and other languages for a specific text processing task: > > http://matthewrocklin.com/blog/work/2014/01/13/Text-Benchmarks/ > > Finally, to learn more about functional data analysis in Python, here is a video tutorial from the same author as the above posts (and it uses the `toolz` library, although the talk isn't strictly about `toolz`): > > http://vimeo.com/80096814 > > Cheers, > Erik > > >> On Mon, Jan 20, 2014 at 6:59 PM, iynaix wrote: >> Quick aside: >> >> If you're on Python 2.7 and above, you can do the following: >> >> from collections import Counter >> counts = Counter(words_list) >> >> Counter is a dictionary-like object that has nice utilities such as being able to add or subtract counters from one another, and most_common(), which is very useful. See the link below for the official docs: >> >> http://docs.python.org/2/library/collections.html#collections.Counter >> >> Cheers, >> XY >> >> >>> On Tue, Jan 21, 2014 at 5:09 AM, wrote: >>> The most interesting thing[1] was interesting because I should have known it. >>> It used the dictionary get method to count words. >>> >>> counts = {} >>> for word in words_list: >>> counts[word] = counts.get(word, 0) + 1 >>> >>> We had to look it up in Learning Python by Mark Lutz. >>> (p 210 in a printing of 4th edition.) >>> >>> It reminded me of the introductory examples on starting on page 19 of pfda[2]. >>> >>> Someone just passed the CISSP exam, so now can play with Python. >>> If he passed, his employer would pay for it (about $600). >>> If he failed, his employer would not pay for it. >>> It was a four hour multiple choice exam. >>> One gets a pass/fail grade. 70% is passing. >>> One is not told how well one did. >>> >>> http://scott.a16z.com/2014/01/17/success-at-work-failure-at-home/ >>> http://bhorowitz.com/2014/01/02/can-do-vs-cant-do-cultures/ >>> >>> wp:Newton's method >>> need to by my post my euler to github Euler #80 11.7 ms >>> https://github.com/fandi-peng/Project_Euler/raw/master/code/euler80.py >>> >>> someone was messing with vincent 2013-05-09 >>> https://mail.python.org/pipermail/centraloh/2013-May/001670.html >>> >>> wp:Linear algebra >>> wp:Linear programming >>> >>> wp:Weibull distribution >>> >>> Bunnie doing open source hardware >>> wp:Andrew Huang >>> http://www.eetimes.com/author.asp?section_id=69&doc_id=1320638 >>> http://dangerousprototypes.com/2012/08/23/workshop-video-36-beers-in-bunnies-workshop/ >>> http://dangerousprototypes.com/2012/04/19/video-hua-qiang-bei-market-in-shenzhen-china/ >>> >>> http://www.zdnet.com/uks-security-branch-says-ubuntu-most-secure-end-user-os-7000025312/ >>> >>> nbconvert crashes converting .ipynb to html or pdf >>> simple ones work >>> complex ones, such as with Latex, crash >>> >>> ghosts can not be shone in China >>> shall not promote superstitious stuff in China >>> >>> http://172.17.153.149:8000/Word_Count_Example.ipynb >>> counts = dict() >>> for word in words_list: >>> counts[word] = counts.get(word, 0) + 1 >>> >>> wp:Chromium (web browser) >>> wp:SRWare Iron >>> >>> There are towns in China that are built as movie sets to promote the making of >>> movies there. Do the residents become extras? >>> wp:Extra (acting) >>> >>> https://github.com/ipython/ipython/tree/master/examples/notebooks#a-collection-of-notebooks-for-using-ipython-effectively >>> http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/notebooks/Part%204%20-%20Markdown%20Cells.ipynb >>> >>> wp:CISSP >>> >>> CYNIC, n. A blackguard whose faulty vision sees things as they are, not as they >>> ought to be. Hence the custom among the Scythians of plucking out a cynic's >>> eyes to improve his vision. >>> >>> PITH, n. See Dorothy Parker >>> Tallulah Bankhead >>> What do Tata and Ford have in common? >>> >>> The Devil's Dictionary >>> >>> pypy is faster than cpython >>> speed.pypy.org >>> >>> open-source food? >>> http://www.wildfermentation.com/ >>> http://www.npr.org/2012/06/13/154914381/fermentation-when-food-goes-bad-but-stays-good >>> >>> wp:Charles Csuri >>> http://oncampus.osu.edu/v29n18/thisissue_6.html >>> https://duckduckgo.com/html/?q=charles%20csuri%20wosu%20beyond%20boundaries >>> wp:Lava lamp >>> >>> Polymorphism (computer science), the ability in computer programming to present >>> the same interface for differing underlying forms (data types). >>> Operator overloading can be an example of polymorphism. >>> wp:Polymorphism (computer science) >>> wp:Operator overloading >>> Python supports polymorphism >>> >>> On Fri, 17 Jan 2014 19:48:27 -0500, Fandi Peng wrote: >>> >>> > https://github.com/brandon-rhodes/astronomy-notebooks >>> >>> That's a great introduction to (i)python and is getting some maintainance >>> attention, including the addition of a pandas notebook. >>> >>> There are probably more notes and ipython notebooks coming for >>> this dojo. >>> >>> [1] See http://colug.net/python/dojo/20140117/word-count-example-rev2.ipynb >>> >>> [2] Python for Data Analysis by Wes McKinney >>> this book just keeps coming back up >>> http://shop.oreilly.com/product/0636920023784.do >>> http://blog.wesmckinney.com/ >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh -------------- next part -------------- An HTML attachment was scrubbed... URL: From joskra42.list at gmail.com Fri Jan 24 21:10:09 2014 From: joskra42.list at gmail.com (Joshua Kramer) Date: Fri, 24 Jan 2014 15:10:09 -0500 Subject: [CentralOH] Capturing stdin/out when using ctypes? Message-ID: Hello Group... Here's a tricky one. My platform is cpython 2.7 on Windows 7. I am using the ctypes library to run a routine inside of a third-party DLL. This DLL presents the user with a prompt and waits for input. If I spawn an .exe from a Python script, I can capture stdout and insert data on stdin. Is there some way to do this when I am calling a DLL instead of spawning an .EXE? I could write a small "stub script" that does all of the DLL work, and then call that stub script from my main script by spawning "c:\python27\python.exe c:\users\josh\myscript.py" and attaching to the stdin/out of that subprocess. But I'd like to have everything neatly contained in one process if possible. Thanks! -JK -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Mon Jan 27 22:10:42 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 27 Jan 2014 16:10:42 -0500 Subject: [CentralOH] Meeting Python Tonight Message-ID: <20140127161042.2cc54e6e.jep200404@columbus.rr.com> Hi everyone, The monthly meeting is tonight. See cohpy.org. From jep200404 at columbus.rr.com Tue Jan 28 20:08:11 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Tue, 28 Jan 2014 14:08:11 -0500 Subject: [CentralOH] =?utf-8?q?2014-01-27_=E6=9C=83=E8=AD=B0_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8gSm9obiBDYXNzaWR5OiBKeXRob247IFJheW1vbmQg?= =?utf-8?q?Chandler_III=3A_Super_Advanced_Python?= Message-ID: <20140128140811.7d40c294.jep200404@columbus.rr.com> Thanks again to Nate Bennick and Pillar Technology for hosting us at The Forge. They catered more than we could eat. John Cassidy gave presentation on Jython What is URL for slides? Jython 2.5.3 implements Python 2.5.3 There is a Jython 2.7 version under development for Python 2.7 When that's done, they'll do Jython 3 for Python 3 Raymond Chandler III (re)presented Super Advanced Python https://www.spkrbar.com/profile/1 https://www.spkrbar.com/talk/11 generators are cool https://mail.python.org/pipermail/centraloh/2013-June/001718.html spkrbar.com has certificate problems with Knoppix. wp:Apollo Computer wp:Single-level store wp:Domain/OS http://jim.rees.org/apollo-archive/ http://jim.rees.org/apollo-archive/monitor-info http://web.archive.org/web/20000304201403/http://cvs.anu.edu.au/monitorconversion/apollo.html http://web.archive.org/web/20000603081917/http://cvs.anu.edu.au/monitorconversion/Gsync.gif http://web.archive.org/web/20000306013122/http://cvs.anu.edu.au/monitorconversion/monitor-info http://web.archive.org/web/20010418164040/http://www.dse.nl/~skyline/monpc.html From guy.jacks at gmail.com Tue Jan 28 22:49:48 2014 From: guy.jacks at gmail.com (Guy Jacks) Date: Tue, 28 Jan 2014 16:49:48 -0500 Subject: [CentralOH] looking for some mentors Message-ID: Hi Guys, I've been developing a moderately sized Flask app for a few months now and my code has become a bit of a mess. I've tried my best to balance making progress with coding things the best way. Specifically, I would like to buy a few hours of time to help me restructure my application. I'm thinking an hour or two to look over my code and an hour or two to walk me through suggestions. Maybe another hour or so for answering follow up questions. Thank you. -- Guy Jacks Fndrz (coming soon) mobile: 614.448.7649 guy.jacks at gmail.com gtalk: guy.jacks skype: guy.jacks -------------- next part -------------- An HTML attachment was scrubbed... URL: From kurtis.mullins at gmail.com Tue Jan 28 22:56:06 2014 From: kurtis.mullins at gmail.com (Kurtis Mullins) Date: Tue, 28 Jan 2014 16:56:06 -0500 Subject: [CentralOH] looking for some mentors In-Reply-To: References: Message-ID: If you're close enough to Dayton to meet up around here, I'd be happy to help on one of the weekends my son is with his mother (this weekend and every other one there-after) If you can't find anyone else, we might be able to arrange something online. I just think it would be a lot easier in-person. On Tue, Jan 28, 2014 at 4:49 PM, Guy Jacks wrote: > Hi Guys, > > I've been developing a moderately sized Flask app for a few months now and > my code has become a bit of a mess. I've tried my best to balance making > progress with coding things the best way. > > Specifically, I would like to buy a few hours of time to help me > restructure my application. I'm thinking an hour or two to look over my > code and an hour or two to walk me through suggestions. Maybe another hour > or so for answering follow up questions. > > Thank you. > > -- > Guy Jacks > Fndrz (coming soon) > > mobile: 614.448.7649 > guy.jacks at gmail.com > gtalk: guy.jacks > skype: guy.jacks > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: