As usual, there are additional optional settings, including  options for how to handle data near the  endpoints (see mode): the default (mode = interp) is to fit the last window_length / 2 points to a polynomial of order polyorder.  See the Scipy reference manual page for details. 

Sample Python code

Here is an example of how to use the SciPy function savgol_filter for data smoothing.