When strings become spaghetti:
Working with strings and files, particular when using the for {line} in {filehandle}: construct, allows us to do some cool manipulation of data, by finding, splitting and stripping the data into different chunks based on some repeating factor (such as a comma spearating each value in order), then sorting, counting and totalling those values through iterative loops. [Read more…] about Coding 101 (part 6)
code
Holy Crap… Coding Can Be Dangerous
Independent, UK: Man accidentally ‘deletes his entire company’ with one line of bad code. Let this be a warning to us all.
(Hat tip to @JamesGrundner and @Chuck_Moeller‘s DevOps Daily.)
PS: A sensible disaster recovery plan should always include non-connected back-up copies held offsite (certainly where it’s business-critical like it was in this case).
Coding 101 (part 3)
This post follows on from my earlier posts Coding 101 (part 1) and (part 2), and is my responses and learnings from the highly-recommended Python programming book and course by Charles Severance (see References below).
Functions:
Functions are sections of code (a sequence of executable steps) which we want to be able to use and re-use at many points in our program. It may be that we want to read and process a whole range of data over and over (but the process done to all the data is the same) or maybe there are a number of inputs required from the user which all need to be processed the same way. Rather than rewriting the same lines of code again and again in our program, we can give that section of code a name (known as ‘defining the function’). We can then ‘call’ that named function, that is, ask Python to execute the defined sequence of steps, at any future point within our program, and as many times as we want. (In other programming languages this same functionality may be referred to as sub-programs or sub-routines.) [Read more…] about Coding 101 (part 3)
Coding 101 (part 2)
This post follows on from my earlier post Coding 101, and is my responses and learnings from the highly-recommended Python programming book and course by Charles Severance (see References below).
Jargon:
I’m working on a glossary here, but still very unstructured and massively incomplete so I suggest staying with Google for now .
Some necessary concepts:
Programming consists of sentences or statements, which may include reserved words, which tell Python what we want it to do, but will also include some values in both numerical and text formats. These take the form of either constants, whose values don’t change, and variables, [Read more…] about Coding 101 (part 2)
Coding 101
A word before I begin
You can do no better in learning Python programming for data handling/analysis than to study for yourself one of Charles Servance’s MOOC’s, or to download and work through his freely-available, ‘remixed’ open-source book (see References below for links to both). I am not even standing of the shoulders of giants here… I am merely scurrying along way behind them all, picking up what few crumbs of knowledge and wisdom I can along the way. Blogging my own educational journey – as a 40-somthing woman heading into the world of tech – is a way to help me consolidate my own learnings. If it can help you too – above all by showing empirically that “if she can, then I can” – it will have served a double purpose. [Read more…] about Coding 101