title: Getting "AttributeError: 'numpy.ndarray' object has no attribute 'transform'" from esda.Moran
body: <p>Trying to get Moran's I. A test but getting &quot;AttributeError: 'numpy.ndarray' object has no attribute 'transform'&quot; because of the last line of code. Both of the variables are arrays and they look like this:</p>
  <pre><code>0       1024.798431
  1        859.662720
  2        870.632530
  3        819.316065
  4        930.600992
             ...     
  5567     842.415062
  5568     991.513211
  5569     908.701993
  5570     909.431369
  5571     644.946254
  Name: Auxilio, Length: 5572, dtype: float64
  </code></pre>
  <p>peso_espacial:</p>
  <pre><code>array([876.56886196, 815.34772578, 871.227145  , ..., 903.74618016,
         880.30363602, 885.61222452])
  </code></pre>
  <p>And the code is this:</p>
  <pre><code>mun = geobr.read_municipality(code_muni=&quot;all&quot;, year=2019)
  mun = mun.rename(columns={'code_muni': 'Municipio'})
  mun['Municipio'] = mun['Municipio'].astype(int).astype(str).str[:-1].astype(np.int64)
  impacto2020 = pd.read_excel(path)
  mapa = pd.merge(mun,impacto2020,on='Municipio',how='left')
  qW = ps.lib.weights.Queen.from_dataframe(mapa)
  qW.transform = 'r'
  peso_espacial = lp.weights.lag_spatial(qW, mapa['Auxilio'])
  peso_espacial = np.nan_to_num(peso_espacial)
  auxilio = mapa['Auxilio']
  from esda.moran import Moran
  moran = Moran(auxilio, peso_espacial)
  </code></pre>
  <p>Don't know how to fix it, already tried converting it to a Series but it gets pretty much the same AttributeError. And this should return a number between 0 and 1.</p>
  <p>Full error traceback:</p>
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-63-e8e3103abd6b&gt; in &lt;module&gt;
        1 from esda.moran import Moran
  ----&gt; 2 moran = Moran(auxilio, peso_espacial)
  
  /opt/anaconda3/lib/python3.8/site-packages/esda/moran.py in __init__(self, y, w, transformation, permutations, two_tailed)
      159         y = np.asarray(y).flatten()
      160         self.y = y
  --&gt; 161         w.transform = transformation
      162         self.w = w
      163         self.permutations = permutations
  
  AttributeError: 'numpy.ndarray' object has no attribute 'transform'
  </code></pre>