title: Copy an N-Index column of a Pandas Dataframe including all sub-headers
body: <p>This question expands off of a previous question of mine:
  <a href="https://stackoverflow.com/q/72652509/5178442">Copy a Multi-Index column of a Pandas Dataframe including the second header</a></p>
  <p><strong>EDIT -</strong> Clarifying that one of my issues deals with the discrepancy when <code>N=1</code> (produces an <code>Index</code> dataframe) and when <code>N&gt;1</code> (produces a <code>MultiIndex</code> dataframe...)</p>
  <p><strong>Background -</strong> I have a dataset with <code>N</code> headers that I've read from a CSV. <code>N</code> can be anything greater than <em>or equal to</em> 1...</p>
  <p>e.g. <code>N=1</code>:</p>
  <pre><code>df = pd.read_csv(file, header=[0:N])
  print(df)
  
       A   B   C 
  ---------------  (Single-)Index dataframe
  0    1   2   3
  1    4   5   6
  2    7   8   9
         ...
  </code></pre>
  <p>e.g. <code>N=3</code>:</p>
  <pre><code>df = pd.read_csv(file, header=[0:N])
  print(df)
  
       A   B   C
       a   b   c
       ɑ   β      
  ---------------  MultiIndex dataframe
  0    1   2   3
  1    4   5   6
  2    7   8   9
         ...
  </code></pre>
  <p><strong>What I Want -</strong> I'd like to duplicate one of the columns (say, <em><strong>A</strong></em>) into a new column <em><strong>D</strong></em>, such that its sub-headers are copied as-is for an arbitrary (<code>N</code>) number of index headers...</p>
  <pre><code>     A   B   C   D
    ...N header rows...
       a   b   c   a
       ɑ   β      ɑ
  ----------------------
  0    1   2   3   1
  1    4   5   6   4
  2    7   8   9   7
         ...
  </code></pre>
  <p><strong>Current Solution -</strong> ...based on answers to my <a href="https://stackoverflow.com/a/72652577/5178442">original</a> question, I can do this with a fixed number of header rows, <code>N</code>...</p>
  <p>e.g. <code>N=2</code>:</p>
  <pre><code>df[('D',df['A'].columns[0])] = df['A'] 
  </code></pre>
  <p>But this won't work for a normal, single-Index dataframe, since <code>df['A']</code> won't have a <code>.columns</code> attribute...</p>
  <p><strong>Need For Extension -</strong> ...I'm unsure what the most pythonic way to handle <code>N</code> rows might be... presently I've made an <code>if</code> case for <code>N=1</code> and <code>N=2</code>, but that feels clunky...</p>
  <p>I wonder if there's a way to force a single-<code>Index</code> dataframe to be a <code>MultiIndex</code> dataframe with a single index row?</p>