data_basedb_initializerssynapse_activation_binningsynapse_activation_postprocess_pandas

synapse_activation_postprocess_pandas

data_base.db_initializers.synapse_activation_binning.synapse_activation_postprocess_pandas(pdf, groupby='', prefun=None, applyfun=None, postfun=None)

Calculates bins of synapse activation per trial from a pandas dataframe.

Parameters:
  • pdf (pandas.DataFrame) – synapse activation dask dataframe

  • groupby (str) – species for which subgroups the bins should be calculated. Available values include:

    • celltype

    • presynaptic\_column

    • proximal (soma distance < 500 um)

    • EI (Lumping the EXC / INH celltypes together)

    • binned\_somadist: synapse counts for all 50 microns

    • any column in the specified dataframe.

  • db (DataBase) – if specified, the result will be computed immediately and saved in the database immediately.

  • get (dask scheduler) – Specify a dask scheduler for the computation (e.g. dask.distributed.Client.get())

  • prefun (callable) – A function to preprocess the synapse activation dataframe before binning. The function should take a pandas dataframe and return a pandas dataframe. Default: prefun()

  • applyfun (callable) – A function to bin the synapse activations. The function should take a pandas dataframe and return a numpy array. Default: applyfun()

  • postfun (callable) – A function to postprocess the binned synapse activations. The function should take a pandas series and return a numpy array. Default: postfun()

Returns:

Dictionary containing numpy arrays, whose rows are sim trials, and columns are time bins. The dictionary keys are defined by groupby.

Return type:

dict

See also

synapse_activation_postprocess_dask() for the delayed version of this method.