How do I create an empty array/matrix in NumPy?
- by Ben
I'm sure I must be being very dumb, but I can't figure out how to use an array or matrix in the way that I would normally use a list. I.e., I want to create an empty array (or matrix) and then add one column (or row) to it at a time.
At the moment the only way I can find to do this is like:
mat = None
for col in columns:
if mat is None:
…