Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bmtk/analyzer/spike_trains.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def calc_stats(r):

return pd.Series(d, index=['count', 'isi'])

spike_counts_df = spike_trains.to_dataframe().groupby(['population', 'node_ids']).apply(calc_stats)
spike_counts_df = spike_trains.to_dataframe().groupby(['population', 'node_ids'])[['timestamps']].apply(calc_stats)
spike_counts_df = spike_counts_df.rename({'timestamps': 'counts'}, axis=1)
spike_counts_df.index.names = ['population', 'node_id']

Expand All @@ -343,7 +343,7 @@ def calc_stats(r):
vals_df = pd.merge(nodes_df, spike_counts_df, left_index=True, right_index=True, how='left')
vals_df = vals_df.fillna({'count': 0.0, 'firing_rate': 0.0, 'isi': 0.0})

vals_df = vals_df.groupby(group_by)[['firing_rate', 'count', 'isi']].agg([np.mean, np.std])
vals_df = vals_df.groupby(group_by)[['firing_rate', 'count', 'isi']].agg(['mean', 'std'])
return vals_df
else:
return spike_counts_df
Expand Down
Empty file.
Loading
Loading