@classmethod
def _make_internals(cls, df_mod, p, column):
    """Populate internals between a first and last index per group.
        This determines the interval. See df_mod for caution. Steps:

        - Make series comprising intervals for each group
        - Make a temp df joining intervals of d (d_intervals) to replicate values
        - Add the prior d_ row to the correl. interval for internal d_

        Parameters
        ----------
        df_mod : DataFrame
            Passed in modified DataFrame.  CAUTION: Assumes label_ column is
            present.  Also assumes interface and discont. rows are correctly
            populated.
        p : int
            Passed in self.p; number of data points.
        column: str
            Column to assign internals.

        Notes
        -----
        .. math::

            x_i = x_0 + sigma_{i=1}^p (delta * i)
            inv = (x_n - x_0)/(p-1)

        Raises
        ------
        ZeroDivisionError
            If p = 1, internals cannot be made.

        """
    df = df_mod.copy()
    internal_idx = df[df['label'] == 'internal'].index.tolist()
    first = df.groupby('layer').first()
    last = df.groupby('layer').last()
    if p == 1:
        raise ZeroDivisionError('p-1.  Interval cannot be calculated.')
    else:
        intervals = (last[column] - first[column]) / (p - 1)
        intervals.name = 'intervals'
    s_first = first[column]
    s_first.name = 'firsts'
    joined = df.join(s_first, on='layer')
    joined = joined.join(intervals, on='layer')
    """Interval or internal sums?"""
    trunc = joined[(joined['label'] != 'interface') & (joined['label'] !=
        'discont.')]
    internal_sums = trunc.groupby('layer')['intervals'].cumsum()
    df.loc[internal_idx, column] = joined.loc[internal_idx, 'firsts'
        ] + internal_sums
    if p % 2 != 0:
        df.loc[df['label'] == 'neut. axis', column] = df[column].mean()
    return df
