init empty numpy array with shape code example
Example 1: numpy empty array
import numpy as np
n = 2
X = np.empty(shape=[0, n])
for i in range(5):
for j in range(2):
X = np.append(X, [[i, j]], axis=0)
print X
Example 2: declare empty array of complex type python
numpy.empty(shape, dtype=float, order='C')
Example 3: create empty numpy array without shape
a = []
for x in y:
a.append(x)
a = np.array(a)