code: def autocorrelation(signal):
      
  
      signal = np.array(signal)
      n = len(signal)
      variance = signal.var()
      signal -= signal.mean()
      
      r = np.correlate(signal, signal, mode = 'full')[-n:]
      result = r / (variance * (np.arange(n, 0, -1)))
      
      return np.array(result)
docs: The `correlation <https://en.wikipedia.org/wiki/Autocorrelation#Estimation>`_ of a signal with a delayed copy of itself.
  
          :param signal: A 1-dimensional array or list (the signal).
          :type signal: array
          :return: The autocorrelated signal.
          :rtype: numpy.ndarray