Extracting Data Subsets and Design By Composition

The request was murky. It evolved over time to this:

Create a function file_record_selection(train.csv, 2, 100, train_2_100.csv)

First parameter: input file name (train.csv)

Second parameter: first record to include (2)

Third parameter: last record to include (100)

Fourth parameter: output file name (train_2_100.csv)

Fundamentally, this …

more ...

Fizz Buzz Overthought, Project Euler #1, and Unit Tests

This. http://www.tomdalling.com/blog/software-design/fizzbuzz-in-too-much-detail/

And many other thoughts on overthinking fizz buzz. I'm going to overthink it, also. Why not?

This is a problem where the obvious unit test may not cover the cases properly. See https://projecteuler.net/problem=1 for a unit test case …

more ...

Functional Python, Literate Programming & Trello Board Analysis


The Depths of Degradation or How to Reduce

Let's talk real-world functional programming. Disclosure: I'm a fan of functional programming in Python. (This: https://www.packtpub.com/application-development/functional-python-programming)

The usual culprits for functional programming are map(), filter(), generator functions, and the various comprehensions. This is very pleasant and can lead to succinct, expressive code.

The reduce operation …

more ...