Skip to content

Commit

Permalink
nan mean and nanstd
Browse files Browse the repository at this point in the history
  • Loading branch information
zm711 committed Oct 4, 2023
1 parent f6b6666 commit 5087ff6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/spikeanalysis/spike_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,8 @@ def plot_response_trace(
)
elif by_neuron:
for neuron in range(np.shape(response)[0]):
avg_response = np.mean(response[neuron], axis=0)
ebars = np.std(response[neuron], axis=0)
avg_response = np.nanmean(response[neuron], axis=0)
ebars = np.nanstd(response[neuron], axis=0)
if ebar:
self._plot_one_trace(
current_bins,
Expand All @@ -836,8 +836,8 @@ def plot_response_trace(
)
elif by_trial:
for trial in range(np.shape(response)[1]):
avg_response = np.mean(response[:, trial, :], axis=0)
ebars = np.std(response[:, trial, :], axis=0)
avg_response = np.nanmean(response[:, trial, :], axis=0)
ebars = np.nanstd(response[:, trial, :], axis=0)
if ebar:
self._plot_one_trace(
current_bins,
Expand All @@ -859,8 +859,8 @@ def plot_response_trace(
stim_lines=current_length,
)
else:
avg_response = np.mean(np.mean(response, axis=1), axis=0)
ebars = np.std(np.mean(response, axis=1), axis=0)
avg_response = np.nanmean(np.nanmean(response, axis=1), axis=0)
ebars = np.nanstd(np.nanmean(response, axis=1), axis=0)
if ebar:
self._plot_one_trace(
current_bins,
Expand Down

0 comments on commit 5087ff6

Please sign in to comment.