code: def calc_L(A):
      
      I = np.eye(A.shape[0])   # noqa
      if type(A) is pd.DataFrame:
          return pd.DataFrame(np.linalg.inv(I-A),
                              index=A.index, columns=A.columns)
      else:
          return np.linalg.inv(I-A)
docs: Calculate the Leontief L from A
  
      Parameters
      ----------
      A : pandas.DataFrame or numpy.array
          Symmetric input output table (coefficients)
  
      Returns
      -------
      pandas.DataFrame or numpy.array
          Leontief input output table L
          The type is determined by the type of A.
          If DataFrame index/columns as A