How do I create an empty array/matrix in NumPy?
I can't figure out how to use an array or matrix in the way that I would normally use a list. 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:
mat = col
else:
mat = hstack((mat, col))
Whereas if it were a list, I'd do something like this:
list = []
for item in data:
list.append(item)
Is there a way to use that kind of notation for NumPy arrays or matrices?