A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
'''A few notes before we begin | |
I'll separate my notes into three types, docstrings like this, whole line comments, and | |
inline comments. Docstrings will discuss the ideas behind the objects. What's the intent, | |
and what programming concepts do they present that are worth discussing. Full line comments | |
will discuss the details of the implementation. What the code is doing and why. Inline | |
comments will comprise a small portion of my notes, and are mostly to point out examples | |
mentioned in the rest of my notes, or return values. Another convention that I use is | |
backticks, which will be used to refer to an actual object in the code. If I say the word | |
one, it's just a word, but `one` is a reference to some object in code. |
import numpy as np | |
def cartesian(arrays, out=None): | |
""" | |
Generate a cartesian product of input arrays. | |
Parameters | |
---------- | |
arrays : list of array-like | |
1-D arrays to form the cartesian product of. |