Michael Gracie

Learn Python, Faster

The premise for picking up the language is a melting pot of tangential reasoning, including having a shiny new Macbook Pro to fiddle with (yes, old reliable is gone), and that Coursera was conveniently offering a beginner’s class in the language. We can feasibly toss in that R has physical memory limitations when it comes to dataset size – not that yours truly will ever hit that ceiling, but this IS the excuses part of the story after all – and that there are plenty of data analysis tools available for Python, without such constraints. Finally, the fish barely bite in the winter (plus I need new waders), and every time I think about hitting a bucket of balls it starts snowing. I reiterate – plenty of excuses.

pythonfordataanalysisInside of two weeks I was learning a bit of Python, but seeing as daylight savings time is still a dream it was easy to get ahead of the pre-defined pace of Coursera’s Programming for Everyone. So I started reading the related textbook Python for Informatics (PDF download) and doing the exercises within, figuring I could just fill in the blanks as the assignments came due. High quality, engaging material.

Passed chapter ten, where the related course actually ends, but when I attempted to use Python to model all protein-coded genes in the human body against cancer incidents replicate a historical trust transactions analysis I’d previous done in R, failing at the twelfthsixth … second if/elif loop, I realized I still knew jack squat about Python. Almost dumb.

Long story [cut] short, Codecademy wound up the perfect solution for getting the skills tuned towards par while impatience loomed mightily nearby. Knocked off their entire Python segment in just a few evenings and found it well worth the time. If a blitzkrieg pace can be considered time.

Side note: The Coursera class is based on Python 2.7, but I had already installed Python 3.4 as part of the Anaconda Scientific Python Distribution from Continuum Analytics. In addition to a GUI-based launcher, the python command executed from terminal validated version 3.4 was running. However, I also discovered that by dragging the entire /anaconda directory from my home folder into /Documents, I could run the stock Python 2.7 that comes with all Macs. Drag it back … voilĂ  … version 3.4 became available again. With 2.X and 3.X stuck in a fight, I suspect Continuum made this possible on purpose. So kudos goes to them.

Yet another side note: Since Python is all about scripting, I initially thought about using the perpetual standby, Xcode, which had served me well for drafting SQL queries and for pulling off obscure text file tricks. But when I ran across Sublime Text it was game over. Now running a licensed beta version 3; ignore the naysayers regarding the price tag, as the app is likely the best $70 bucks you’ll ever spend on technology. No “affiliate” linkage required – Sublime is that damn good – and I think I’ll now use it instead of MS Word too.

MG signing off (to polish the effort to a luxurious shine with one more book)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.