neuroglia.event.PeriEventTraceReducer

class neuroglia.event.PeriEventTraceReducer(traces, sample_times, func=<function mean>)[source]

Take event-aligned samples of traces from a population of neurons.

Traces are sampled relative to the event time. There is no enforced constraint that the times of events or sample_times relative to the events need to align to trace sample times. Rather, samples are interpolated from the values in the traces DataFrame.

Parameters:
  • traces (pandas DataFrame with 'time' as the index and neuron IDs in columns) – The traces that will be sampled from when the transform method is called
  • func (function) – Function that will be applied to trace samples within epochs

Notes

This estimator is stateless (besides constructor parameters), the fit method does nothing but is useful when used in a pipeline.

__init__(traces, sample_times, func=<function mean>)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

Methods

__init__(traces, sample_times[, func]) x.__init__(…) initializes x; see help(type(x)) for signature
fit(X[, y]) Do nothing and return the estimator unchanged
fit_transform(X[, y]) Fit to data, then transform it.
get_params([deep]) Get parameters for this estimator.
set_params(**params) Set the parameters of this estimator.
transform(X) Reduce traces around each event