Skip to content

Commit

Permalink
nanmean of signal
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanharvey1 committed Jan 8, 2025
1 parent 58ec8db commit b2bbafe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions neuro_py/process/peri_event.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import warnings
from typing import List, Optional, Tuple, Union

import bottleneck as bn
import numpy as np
import pandas as pd
from nelpy import EpochArray
Expand Down Expand Up @@ -730,10 +731,11 @@ def event_triggered_average_fast(
return pd.DataFrame(
index=time_lags,
columns=np.arange(signal.shape[0]),
data=avg_signal.mean(axis=2).T,
data=bn.nanmean(avg_signal, axis=2).T,
)

if return_average:
return avg_signal.mean(axis=2), time_lags
return bn.nanmean(avg_signal, axis=2), time_lags
else:
return avg_signal, time_lags

Expand Down

0 comments on commit b2bbafe

Please sign in to comment.