Python 🐍

Python 🐍

For years and years now I’ve always thought of Python as just another pesky programming language to learn and use when that’s what is available with the applications and APIs I need to use. A language with obnoxious tabs and devoid of brackets and semicolons that are common in other languages like C and PERL.

Sure I’ve written Python on and off for like five years, learning some python by getting a book out of the library, studying the oddities of the language and then diving into coding a few custom plugins for QGIS to automate my work flow creating maps for the blog. At one level Python is like every other language out there, the functions the classes, the variables. My general impression of Python was it reassembled Perl minus the oddities that make up the largely forgotten language that once powered the internet’s CGI scripts. I used Python but it was begrudgingly.

I’ve always liked PHP a lot. The standard library in PHP is enormous, the API rich with functions and classes to call out of the box. WordPress links closely with it and provides also a rich API. I use PHP and abuse it for purposes it’s not really designed for like processing shapefiles and shell scripting. Things like that should be really done in BASH or Python but I’ve always found PHP easier as I’ve used it on and off for two decades.

Then I discovered Geopandas, seeking a better way to manipulate and join shapefiles without opening QGIS. Which you can do a lot of that on the command line utilities like ogr2ogr, there are limits to what you can feed into that tool and get out. I wanted something more powerful and advanced than ogr2ogr and that lead me back to Python. So I somewhat begrudgingly went back to Python. And discovering PANDAS and Jupyter, I found something I really liked.

I don’t think you could call me a newbie at this point with Python but data science wasn’t part of my lexicon and certainly not something that I had ever done much in the past. Sure, I had manipulated data in Microsoft Excel and LibreOffice Calc for years, doing fancy pivot tables and formulas but writing a computer program to manage data seemed tedious and a lot of coding and debugging for something I could do relatively quickly in Excel. I’ve written many programs in the past to manage data – mostly in PHP or perl but also some in Python but it mainly was for datasets that I would regularly use like the weather data and graphs on my blog.

But since discovering Jupyter, which let’s you easily execute a few lines of python at one – testing out things and experimenting, learning the full power of the many rich python libraries like PANDAS and Numpy, my views have changed. I’ve discovered that often a few lines of python can replace a lot of mouse clicks in az spreadsheet and repeative tasks can either be fully automated or executed with a few hits of the return key.

Leave a Reply

Your email address will not be published. Required fields are marked *