Python with Numpy has a lot of boilerplate, but I'm in love with the Python ecosystem. Is there any way, hacky or not, of reducing the boilerplate?
Submitted by twovests in programming (edited )
I want to be able to write
A = [1, 2, 3]
instead of
A = np.array([1, 2, 3]).reshape(1,3)
Because, as much as I hate Matlab, it's got way less boilerplate.
flabberghaster wrote
you could make wrapper functions around your numpy calls that take and return normal lists and do the casting to numpy arrays and reshaping on them; at the end of the day your options for syntax sugar are a bit limited depending on what you're doing.