AttributeError: 'tuple' object has no attribute 'shape'
<p>So I have been writing a code to standardize the elements of a matrix and the function I used is as follows:</p>

<pre><code>def preprocess(Data):
    if stdn ==True:
       st=np.empty((Data.shape[0],Data.shape[1]))
       for i in xrange(0,Data.shape[0]):
           st[i,0]=Data[i,0]
       for i in xrange(1,Data.shape[1]):
           st[:,i]=((Data[:,i]-np.min(Data[:,i]))/(np.ptp(Data[:,i])))       
           np.random.shuffle(st)
       return st
    else:
       return Data
</code></pre>

<p>It works very well outside the class but when used inside of it it gives me this error:</p>

<pre><code>  AttributeError: 'tuple' object has no attribute 'shape'
</code></pre>

<p>Any idea on how I can fix it??
P.S. This is a KNN classification code</p>