title: Do a curve fit for every serial number?
body: <p>I am trying to do a curve fit for every serial number. My first idea was to do it with a group by or with a list and check my df for numbers in my list. But whatever method I can think of, I have to manually enter the serial numbers. Is there any way to check my column serial number and do the curve fit for the first serial number it finds then the second and so on?</p>
  <p>Here is a part of my df:</p>
  <pre><code>    Date    Hour    Minute  Second  Seriel number   mrwSmpVWi   mrwSmpP
  0   04.06.2019  0   0   1   701086  4.2 51
  1   04.06.2019  0   0   1   701092  4.6 75
  2   04.06.2019  0   0   1   701088  4.3 58
  3   04.06.2019  0   0   2   701085  4.2 52
  4   04.06.2019  0   0   2   701091  4.5 71
  5   04.06.2019  0   0   2   701089  4.3 59
  6   04.06.2019  0   0   3   701087  4.0 56
  7   04.06.2019  0   0   4   701090  3.8 44
  8   04.06.2019  0   10  0   701092  4.3 58
  9   04.06.2019  0   10  0   701086  4.3 59
  10  04.06.2019  0   10  1   701088  4.4 63
  11  04.06.2019  0   10  1   701085  4.4 65
  12  04.06.2019  0   10  1   701091  4.5 71
  13  04.06.2019  0   10  2   701089  4.5 69
  14  04.06.2019  0   10  3   701087  4.4 71
  15  04.06.2019  0   10  4   701090  3.5 34
  16  04.06.2019  0   20  0   701092  4.3 64
  17  04.06.2019  0   20  1   701086  4.4 69
  18  04.06.2019  0   20  1   701088  4.3 63
  19  04.06.2019  0   20  1   701091  4.5 73
  20  04.06.2019  0   20  1   701085  4.2 61
  21  04.06.2019  0   20  2   701089  4.4 71
  </code></pre>
  <p>And this is how I want to do my curve fit:</p>
  <pre><code>x=ohlala.T.iloc[5]
  y=ohlala.T.iloc[6]
  
  def logifunc(x,c,a,b):
      return c / (1 + (a) * np.exp(-b*(x)))
  
  result, pcov = curve_fit(logifunc, x, y, p0=[110,400,-2])
  </code></pre>
  <p>My goal is to get a df like the picture.<a href="https://i.stack.imgur.com/7dJfl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7dJfl.png" alt="enter image description here" /></a></p>