def sep_sg(df): #df = df.as_matrix() df[np.isnan(df)] = 0 df = savgol_filter(df, axis=0, window_length=5, polyorder=3) return df