title: How to specify boundary behavior for SciPy's interp1d
body: <p>I'm trying to set the behavior at the boundaries for SciPy's <code>interp1d</code> function, which <a href="http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html" rel="noreferrer">according to the documentation</a> should be possible:</p>
  <pre><code>Behavior at the boundary can be specified at instantiation time.
  </code></pre>
  <p>But I have not found any further information on this.
  <em>The <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html#scipy.interpolate.interp1d" rel="noreferrer">interp1d documentation</a> does not mention it all.</em></p>
  <p><strong>So: How can I define the behavior?</strong></p>
  <p><em>Side-curiosity: What is the default boundary behavior it uses?</em></p>
  <hr>
  <hr>
  <p><strong>Edit:</strong> Examples (Assuming data points between <code>x=0</code> and <code>x=n</code> and cubic interpolation)</p>
  <p>I know of at least three types of boundary behavior that I would like to be able to specify:</p>
  <p><em>flat:</em> I could demand the function to flat out, in other words derivations to be zero.</p>
  <pre><code>f'(0)  = f'(n)  = 0
  f''(0) = f''(n) = 0
  </code></pre>
  <hr>
  <p><em>cyclic:</em> Something among the lines of</p>
  <pre><code>f'(0)  = f'(n)
  f''(0) = f''(n)
  </code></pre>
  <p>Thus the beginning and end have same &quot;slope&quot;.</p>
  <hr>
  <p><em>manual:</em> Or I could manually provide the values for the derivatives...</p>
  <pre><code>f'(0)  = ...
  f'(n)  = ...
  f''(0) = ...
  f''(n) = ...
  </code></pre>
  <p>Although probably not for all four of them at the same time.</p>