Reshaping (and other operations) will sometimes disrupt the contiguity of an array. You can check whether this has happened by looking at the flags:
>>> a = np.arange(10).reshape(5, 2).T
>>> a.flags
C_CONTIGUOUS : False # reshaped array is no longer C contiguous
F_CONTIGUOUS : True
OWNDATA : False
WRITEABLE : True
ALIGNED : True
UPDATEIFCOPY : False
Try making a C contiguous copy of the array with np.ascontiguousarray:
>>> b = np.ascontiguousarray(a)
>>> b.flags
C_CONTIGUOUS : True # array b is a C contiguous copy of array a
F_CONTIGUOUS : False
OWNDATA : True
WRITEABLE : True
ALIGNED : True
UPDATEIFCOPY : False
The function returns an array with the same shape and values as the target array, but the returned array is stored as a C contiguous array.