title: Linear regression:ValueError: all the input array dimensions except for the concatenation axis must match exactly
body: <p>I am looking for a solution for the following problem and it just won't work the way I want to.</p>
  
  <p>So my goal is to calculate a regression analysis and get the slope, intercept, rvalue, pvalue and stderr for multiple rows (this could go up to 10000). In this example, I have a file with 15 rows. Here are the first two rows:</p>
  
  <pre><code>array([
  
  [   1,    2,    3,    4,    5,    6,    7,    8,    9,   10,   11,
            12,   13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
            23,   24],    
  
  [ 100,   10,   61,   55,   29,   77,   61,   42,   70,   73,   98,
            62,   25,   86,   49,   68,   68,   26,   35,   62,  100,   56,
            10,   97]]
  )
  </code></pre>
  
  <p>Full trial data set:</p>
  
  <pre><code>1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
  
  100 10  61  55  29  77  61  42  70  73  98  62  25  86  49  68  68  26  35  62  100 56  10  97
  
  57  89  25  89  48  56  67  17  98  10  25  90  17  52  85  56  18  20  74  97  82  63  45  87
  
  192 371 47  173 202 144 17  147 174 483 170 422 285 13  77  116 500 136 276 392 220 121 441 268
  </code></pre>
  
  <p>The first row is the x-variable and this is the independent variable. This has to be kept fixed while iterating over every following row.</p>
  
  <p>For the following row, the y-variable and thus the dependent variable, I want to calculate the slope, intercept, rvalue, pvalue and stderr and have them in a dataframe (if possible added to the same dataframe, but this is not necessary). </p>
  
  <p>I tried the following code:</p>
  
  <pre><code>import pandas as pd
  import scipy.stats
  import numpy as np
  df = pd.read_excel("Directory\\file.xlsx")
  
  def regr(row):
      r = scipy.stats.linregress(df.iloc[1:, :], row)
      return r
  
  full_dataframe = None
  
  for index,row in df.iterrows():
      x = regr(index)
     if full_dataframe is None: 
         full_dataframe = x.T
     else: 
         full_dataframe = full_dataframe.append([x.T])
  
  full_dataframe.to_excel('Directory\\file.xlsx')
  </code></pre>
  
  <p>But this fails and gives the following error:</p>
  
  <pre><code>ValueError: all the input array dimensions except for the concatenation axis 
  must match exactly
  </code></pre>
  
  <p>I'm really lost in here.</p>
  
  <p>So, I want to achieve that I have the slope, intercept, pvalue, rvalue and stderr per row, starting from the second one, because the first row is the x-variable.</p>
  
  <p>Anyone has an idea HOW to do this and tell me WHY mine isn't working and WHAT the code should look like?</p>
  
  <p>Thanks!!</p>