title: Refining Python code for use (skipping repeated steps)
body: <p>I have been working on a project which requires splitting 10-12 columns and stacking them. The only problem is I have to do it repeatedly. I mean, once I split 1 column, I stack it and then repeat the same steps for other columns.
  Although I have no problem with running the code, I am looking for a way to do it more efficiently.</p>
  
  <p>I am currently repeating the same process 10-12 times and it takes some time to run the code as there are 50+ column names.</p>
  
  <pre><code>df1 = (df1.set_index(['Announced Date', 'Completed Date', 'Target Company',
                        'Target Dominant Sector', 'Target Dominant Country', 'Target State',
                        'Target Financial Advisor', 'Target Legal Advisor', 'Target Broker', 
                        'Target Accountant', 'Target PR', 'Target Consultant',
                        'Bidder Company', 'Bidder Dominant Country', 'Bidder State',
                        'Bidder Financial Advisor', 'Bidder Legal Advisor', 'Bidder Broker', 
                        'Bidder Accountant', 'Bidder PR', 'Bidder Consultant', 
                        'Seller Company', 'Seller Dominant Country', 'Seller State', 
                        'Seller Financial Advisor', 'Seller Legal Advisor', 'Seller Broker', 
                        'Seller Accountant', 'Seller PR', 'Seller Consultant',
                        'Reported Revenue Multiple Y1', 'Reported EBIT Multiple Y1', 'Reported EBITDA Multiple Y1', 
                        'Reported PE Multiple Y1', 'Reported Book Value Multiple Y1', 'Deal Description', 
                        'Deal Type', 'Deal Nature', "Deal Value USD(m)", 
                        'Deal ID', 'Deal within regular criteria','Target companies', 
                        'Target FAs', 'Taget LAs', "Taget Brokers", 
                        "Target Accountants", 'Target PRs','Target Consultants',
                        'Bidder Companies', 'Bidder FAs', 'Bidder LAs', 
                        "Bidder Brokers", "Bidder Accountants","Bidder PRs",
                        "Bidder Consultants",'Seller Companies']).stack()
          .reset_index(level=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,
                            29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55], name='Seller FAs')
          .reset_index(drop=True))
  </code></pre>
  
  <p>I know that instead of typing all column names, I can use</p>
  
  <p><code>df1.columns</code></p>
  
  <p>and instead of using 0-55 numbers individually, I can use</p>
  
  <p><code>np.arange(56)</code></p>
  
  <p>But I am not able to incorporate those in the code. Could someone please help me make it more efficient??</p>