Building a Dataset Using XArray

Authors
Dr. Nicholas Del Grosso | Dr. Sangeetha Nandakumar | Dr. Ole Bialas | Dr. Atle E. Rimehaug

In the previous notebook, you learned how to make DataArrays with Xarray. But Xarray has another level of organization, referred to as a Dataset, which is a collection of DataArrays.

  • The DataArray: A multidimensional array with labels describing each of its dimensions.
  • The Dataset: A collection of DataArrays and their relationships.

We’ll be working with a good amount of data organized in Xarray, mainly to load data, select the variables we’re interested in, and convert the data into the structure we want, so let’s take a little time to familiarize ourselves with some of these features

Setup

Import Libraries

%matplotlib inline

import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[3], line 1
----> 1 get_ipython().run_line_magic('matplotlib', 'inline')
      3 import xarray as xr
      4 import numpy as np

File ~/.local/lib/python3.12/site-packages/IPython/core/interactiveshell.py:2511, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth)
   2509     kwargs['local_ns'] = self.get_local_scope(stack_depth)
   2510 with self.builtin_trap:
-> 2511     result = fn(*args, **kwargs)
   2513 # The code below prevents the output from being displayed
   2514 # when using magics with decorator @output_can_be_silenced
   2515 # when the last Python token in the expression is a ';'.
   2516 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/.local/lib/python3.12/site-packages/IPython/core/magics/pylab.py:103, in PylabMagics.matplotlib(self, line)
     98     print(
     99         "Available matplotlib backends: %s"
    100         % _list_matplotlib_backends_and_gui_loops()
    101     )
    102 else:
--> 103     gui, backend = self.shell.enable_matplotlib(args.gui)
    104     self._show_matplotlib_backend(args.gui, backend)

File ~/.local/lib/python3.12/site-packages/IPython/core/interactiveshell.py:3789, in InteractiveShell.enable_matplotlib(self, gui)
   3786     import matplotlib_inline.backend_inline
   3788 from IPython.core import pylabtools as pt
-> 3789 gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select)
   3791 if gui != None:
   3792     # If we have our first gui selection, store it
   3793     if self.pylab_gui_select is None:

File ~/.local/lib/python3.12/site-packages/IPython/core/pylabtools.py:338, in find_gui_and_backend(gui, gui_select)
    321 def find_gui_and_backend(gui=None, gui_select=None):
    322     """Given a gui string return the gui and mpl backend.
    323 
    324     Parameters
   (...)    335     'WXAgg','Qt4Agg','module://matplotlib_inline.backend_inline','agg').
    336     """
--> 338     import matplotlib
    340     if _matplotlib_manages_backends():
    341         backend_registry = matplotlib.backends.registry.backend_registry

ModuleNotFoundError: No module named 'matplotlib'

Download Data

import owncloud
from pathlib import Path

Path('data').mkdir(exist_ok=True, parents=True)

owncloud.Client.from_public_link('https://uni-bonn.sciebo.de/s/c4T8MndMZTtTtme', folder_pasword = 'ibots').get_file('/', f'data/steinmetz_2017-12-05_Lederberg.nc')
True

Section 1: Working with XArray Datasets

Datasets describe the relationships between multiple data variables, often connected by their coordinates. For example, there could be different behavioral measurements taken at the same time points, or different data might be related to the same subject. xr.Dataset objects help in this way to describe a more-complete picture of an experiment.

Let’s explore Datasets by looking at the data from a session of the Steinmetz et al, 2019 paper . In this notebook, we’ll be exploring the spike counts data recorded during a specific session and investigate differences between brain regions and their relation to behavioral, task, or performance variables. This data, stored in the netCDF format (the .nc extension), can be loaded as an XArray Dataset.

Code Description
xr.load_dataset("file.nc") Load a netCDF file as an XArray Dataset.
dset['variable_name'] Access a specific variable (DataArray) from the dataset.
dset[['var1', 'var2']] Access multiple variables from the dataset simultaneously.
dset['variable'].loc[start:end] Select data using location-based indexing for specific range.
sum(boolean_array).item() Count True values in boolean array and extract as scalar.
len(array) Get the length of an array.

Run the following code cell to load the dataset into Python using XArray. Explore the dataset. Note that different variables are related to different sets of coordinates:

Exercises

dset = xr.load_dataset(f"data/steinmetz_2017-12-05_Lederberg.nc")
dset
<xarray.Dataset> Size: 125MB
Dimensions:             (trial: 340, time: 250, cell: 698,
                         waveform_component: 3, sample: 82, probe: 384,
                         brain_area_lfp: 12, spike_id: 3185888)
Coordinates:
  * trial               (trial) int32 1kB 1 2 3 4 5 6 ... 336 337 338 339 340
  * time                (time) float64 2kB 0.01 0.02 0.03 0.04 ... 2.48 2.49 2.5
  * cell                (cell) int32 3kB 1 2 3 4 5 6 ... 693 694 695 696 697 698
  * waveform_component  (waveform_component) int32 12B 1 2 3
  * probe               (probe) int32 2kB 1 2 3 4 5 6 ... 380 381 382 383 384
  * brain_area_lfp      (brain_area_lfp) <U5 240B 'DG' 'LGd' ... 'MD' 'VISam'
  * spike_id            (spike_id) int32 13MB 1 2 3 ... 3185886 3185887 3185888
Dimensions without coordinates: sample
Data variables: (12/31)
    contrast_left       (trial) int8 340B 0 0 0 100 25 50 0 0 ... 0 0 0 0 0 0 0
    contrast_right      (trial) int8 340B 0 0 0 50 50 50 ... 100 100 100 100 100
    gocue               (trial) float64 3kB 0.4884 0.5617 ... 0.7894 0.7892
    stim_onset          (trial) float64 3kB 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
    feedback_type       (trial) float64 3kB 1.0 -1.0 1.0 1.0 ... -1.0 -1.0 -1.0
    feedback_time       (trial) float64 3kB 2.028 0.9821 2.175 ... 2.331 2.316
    ...                  ...
    waveform_w          (cell, sample, waveform_component) float32 687kB 0.0 ...
    waveform_u          (cell, waveform_component, probe) float32 3MB 0.0 ......
    lfp                 (brain_area_lfp, trial, time) float64 8MB -57.29 ... ...
    spike_time          (spike_id) float32 13MB 0.01967 0.09227 ... 2.355 2.475
    spike_cell          (spike_id) uint32 13MB 1 1 1 1 1 ... 698 698 698 698 698
    spike_trial         (spike_id) uint32 13MB 1 1 1 1 1 ... 450 450 450 450 450
xarray.Dataset
    • trial: 340
    • time: 250
    • cell: 698
    • waveform_component: 3
    • sample: 82
    • probe: 384
    • brain_area_lfp: 12
    • spike_id: 3185888
    • trial
      (trial)
      int32
      1 2 3 4 5 6 ... 336 337 338 339 340
      array([  1,   2,   3, ..., 338, 339, 340], dtype=int32)
    • time
      (time)
      float64
      0.01 0.02 0.03 ... 2.48 2.49 2.5
      array([0.01, 0.02, 0.03, ..., 2.48, 2.49, 2.5 ])
    • cell
      (cell)
      int32
      1 2 3 4 5 6 ... 694 695 696 697 698
      array([  1,   2,   3, ..., 696, 697, 698], dtype=int32)
    • waveform_component
      (waveform_component)
      int32
      1 2 3
      array([1, 2, 3], dtype=int32)
    • probe
      (probe)
      int32
      1 2 3 4 5 6 ... 380 381 382 383 384
      array([  1,   2,   3, ..., 382, 383, 384], dtype=int32)
    • brain_area_lfp
      (brain_area_lfp)
      <U5
      'DG' 'LGd' 'SUB' ... 'MD' 'VISam'
      array(['DG', 'LGd', 'SUB', 'VISp', 'ACA', 'MOs', 'PL', 'CA1', 'DG', 'LH', 'MD',
             'VISam'], dtype='<U5')
    • spike_id
      (spike_id)
      int32
      1 2 3 4 ... 3185886 3185887 3185888
      array([      1,       2,       3, ..., 3185886, 3185887, 3185888], dtype=int32)
    • contrast_left
      (trial)
      int8
      0 0 0 100 25 50 0 ... 0 0 0 0 0 0 0
      array([  0,   0,   0, 100,  25,  50,   0,   0, 100,  25,   0,  25,  50,
               0,   0,   0,  25, 100, 100, 100,  50,  25,  25,  25,   0,   0,
              50, 100,   0,   0, 100,   0,   0,   0,  50,  50,   0,  50,  50,
             100,   0,   0,  25,  25,   0, 100,  50,  25,  50,   0,   0,  25,
             100,   0,   0, 100,  50,   0,  25,  50,   0,   0,  25, 100,   0,
               0,   0,   0,   0, 100, 100,  50,   0,  25,   0,  50,  25,  50,
              25,  25,  25, 100,   0,   0,  25,   0,   0,   0,  50, 100,  25,
               0,   0,   0,   0,   0,   0,  25, 100,   0,   0,   0,   0,  50,
              50,   0,   0,  50, 100,  50,  50,  25,   0,   0,   0,   0,   0,
               0,  25,   0,   0,   0,   0, 100,   0,   0,   0,   0,   0,   0,
               0,   0,  50,   0,   0,   0,   0,   0,   0,   0,   0,  50,  25,
              25,  50, 100,   0,   0,  25,   0,   0, 100, 100,   0,   0, 100,
               0, 100,  50,  25,  50,   0, 100,  50,  25, 100, 100, 100,  50,
               0,  50,  25,  25,  25,  50,   0,   0,   0,   0,   0,   0,   0,
               0,   0,   0,   0,   0, 100,   0,   0,  50,   0,   0,   0,   0,
               0,  50,  25,   0,  25,  25,   0,   0,   0,   0,  50,  25,   0,
               0, 100,  25,   0,   0,   0,  50,  25, 100,   0,   0,   0,   0,
               0,   0,   0,   0,   0,   0, 100, 100,  50,  50, 100,  50,   0,
              25,  25,  25, 100,   0, 100,   0,   0,   0,  25,  50,  25,  25,
              50,   0,  50, 100,  25,   0, 100,   0,  50,  25, 100,  50,  50,
              50,   0,   0, 100, 100,  50,  50,   0,  25,   0, 100, 100,  25,
               0, 100,  50,   0,   0,   0, 100, 100,  50,  50,   0,  50, 100,
              25,  25,  50, 100,  50, 100,  25,   0,  50,   0,   0,   0,   0,
               0,   0,   0,   0, 100,   0,   0,   0,  25, 100, 100, 100,   0,
               0,   0,   0,  25, 100,   0,   0, 100,  25, 100,  25,  25,  50,
             100,  50,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
               0,   0], dtype=int8)
    • contrast_right
      (trial)
      int8
      0 0 0 50 50 ... 100 100 100 100 100
      array([  0,   0,   0,  50,  50,  50,  50, 100,  25, 100,  50, 100,   0,
               0,   0,   0,   0,  50,   0,   0, 100,   0,  25, 100,  25,   0,
              25,  25,   0,   0,  50,   0,   0,   0,   0,  25, 100,   0,  50,
              50,  50,   0,   0,  50,  25,  50,   0, 100,   0, 100, 100,   0,
             100, 100, 100,   0,   0, 100, 100,  25,   0,   0,  50,  25,   0,
             100, 100,   0,   0,   0,  25,   0,   0,  50,   0,  25,  25,  25,
             100,   0,  25,   0,   0,   0,   0,  50,   0,   0,  25,  25, 100,
               0,   0,   0,   0,   0,   0, 100,   0,   0,  50, 100, 100,   0,
              25,   0,   0,   0,   0,   0,  25, 100,   0,   0,   0,   0,   0,
               0, 100,   0,   0,   0,   0,  50,   0,   0,   0,   0,   0,   0,
             100, 100,   0, 100,   0,   0,   0,   0,   0,   0,   0,   0,  50,
             100,   0,   0,   0,   0,  50, 100,   0,  25,  25,   0,   0,  25,
               0, 100,  25, 100,   0,  50,   0, 100, 100,  25,   0,  50, 100,
              25,   0,  50, 100,  50, 100,   0,   0,   0,   0,   0,   0,   0,
               0,   0,   0,   0,   0,  25, 100,   0,   0,  50,  25,   0,   0,
               0, 100,  25,  50,  25, 100,   0,   0,   0,   0, 100,  50,   0,
               0,  25,  50,  50,   0,   0,   0, 100,  25,   0,   0,  25,   0,
               0,   0,   0,   0,   0,   0,   0, 100, 100,  50,  50,  25,  25,
              50, 100, 100,   0,  25,   0,   0,   0,   0,   0, 100, 100, 100,
               0, 100,  50,  50,   0, 100,  25,  50,   0, 100,   0,   0,   0,
              25,  50,  50,  50,  25,  50, 100,   0,   0, 100,   0,  50,   0,
             100,  25,   0,  25,  50,  25, 100,  25,   0,  50,  25,  25,   0,
              50, 100,   0,   0,  25,  25,  50,  50,   0,   0,   0,   0,   0,
               0,   0,   0,  50,   0, 100,  50,   0, 100, 100,   0,  25,   0,
             100,  50,  50,   0,   0,  50,  25,   0,   0,  25, 100,  25,   0,
              25,  50, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
             100, 100], dtype=int8)
    • gocue
      (trial)
      float64
      0.4884 0.5617 ... 0.7894 0.7892
      array([0.48841865, 0.56171624, 0.6277027 , 0.77353535, 0.61263709,
             0.72839327, 0.77820739, 0.66233874, 0.63386641, 0.44806527,
             0.72309279, 0.48826985, 0.56320355, 0.48741344, 0.40065609,
             0.40867261, 0.40519758, 0.45826623, 0.61785096, 0.72780273,
             0.6359332 , 0.66807363, 0.66320184, 0.5058879 , 0.76738597,
             0.6770692 , 0.62228154, 0.67822337, 0.59281896, 0.77301021,
             0.76107631, 0.79780037, 0.42827087, 0.6431434 , 0.71314721,
             0.61172721, 0.76718867, 0.40236408, 0.45802182, 0.46126396,
             0.63226761, 0.72263371, 0.6418007 , 0.74508493, 0.51705922,
             0.77714175, 0.59683823, 0.56767474, 0.43744805, 0.59697573,
             0.47711398, 0.4820389 , 0.7669893 , 0.48216235, 0.62250457,
             0.7473069 , 0.78727484, 0.66693145, 0.67125   , 0.52177099,
             0.41740057, 0.5669238 , 0.60699578, 0.62739084, 0.70705385,
             0.63129674, 0.79720542, 0.57208664, 0.78635025, 0.51704805,
             0.63723618, 0.49176417, 0.53180061, 0.62708314, 0.44227212,
             0.55142033, 0.53169049, 0.75719256, 0.42145264, 0.54966724,
             0.53634796, 0.77579902, 0.53710938, 0.69714292, 0.58019525,
             0.62705861, 0.74681771, 0.74183868, 0.4270687 , 0.74197311,
             0.45669958, 0.61687268, 0.59668802, 0.62129444, 0.69696077,
             0.50667484, 0.56113018, 0.41629755, 0.77705928, 0.51608511,
      ...
             0.41069624, 0.63567106, 0.66570524, 0.71051356, 0.67978922,
             0.6591758 , 0.45460895, 0.52062908, 0.5801893 , 0.62012709,
             0.71477602, 0.58591776, 0.65907354, 0.73929954, 0.6257914 ,
             0.55991738, 0.69002588, 0.60469953, 0.56554717, 0.71460434,
             0.6950691 , 0.52516365, 0.61495259, 0.75344787, 0.42905262,
             0.59459707, 0.56548625, 0.43189034, 0.48555692, 0.66416638,
             0.49997099, 0.66033448, 0.77180753, 0.50448264, 0.48456124,
             0.69431648, 0.54973633, 0.57073016, 0.59482885, 0.72096502,
             0.64981071, 0.59484637, 0.46018813, 0.69214446, 0.6742718 ,
             0.46417024, 0.69456219, 0.52826072, 0.5947646 , 0.62995266,
             0.69882236, 0.57850464, 0.76453035, 0.75957599, 0.50986484,
             0.40022378, 0.47402451, 0.77469096, 0.61014063, 0.75925778,
             0.60908615, 0.75835371, 0.60483325, 0.60963295, 0.66916011,
             0.62968463, 0.69432738, 0.40507228, 0.59356458, 0.58959661,
             0.50473541, 0.67970194, 0.51677721, 0.64535707, 0.68420267,
             0.69940944, 0.488297  , 0.66372588, 0.45982753, 0.77415393,
             0.77894818, 0.61375407, 0.48408199, 0.73298968, 0.50836249,
             0.56847091, 0.52441248, 0.41031817, 0.45388966, 0.40969042,
             0.42125827, 0.76423648, 0.68824672, 0.53006278, 0.434965  ,
             0.77343027, 0.68478504, 0.65960524, 0.78944758, 0.78920937])
    • stim_onset
      (trial)
      float64
      0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
      array([0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
             0.5, 0.5])
    • feedback_type
      (trial)
      float64
      1.0 -1.0 1.0 1.0 ... -1.0 -1.0 -1.0
      array([ 1., -1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1., -1.,  1.,  1.,  1.,  1.,  1., -1., -1.,  1.,  1.,  1.,  1.,
              1.,  1., -1.,  1.,  1., -1.,  1.,  1., -1., -1.,  1.,  1.,  1.,
              1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1.,  1.,  1.,  1.,  1.,  1.,  1., -1.,  1.,  1.,  1.,  1.,  1.,
              1.,  1., -1.,  1.,  1.,  1.,  1.,  1., -1.,  1.,  1., -1.,  1.,
              1.,  1., -1.,  1., -1.,  1.,  1.,  1., -1.,  1.,  1.,  1.,  1.,
             -1., -1., -1., -1., -1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1., -1.,  1.,  1.,  1.,  1.,  1.,  1.,  1., -1., -1., -1.,  1.,
              1.,  1., -1., -1., -1.,  1.,  1.,  1.,  1., -1., -1., -1.,  1.,
              1.,  1.,  1.,  1., -1., -1., -1., -1., -1., -1.,  1.,  1.,  1.,
              1.,  1.,  1., -1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1.,  1.,  1.,  1.,  1.,  1.,  1., -1.,  1.,  1.,  1.,  1., -1.,
              1.,  1., -1.,  1.,  1.,  1.,  1., -1., -1.,  1., -1., -1., -1.,
             -1., -1., -1., -1.,  1.,  1.,  1.,  1.,  1.,  1.,  1., -1., -1.,
              1.,  1., -1.,  1.,  1.,  1., -1., -1., -1.,  1.,  1.,  1., -1.,
              1.,  1.,  1.,  1., -1.,  1.,  1.,  1.,  1., -1.,  1.,  1., -1.,
              1., -1., -1., -1., -1.,  1.,  1.,  1., -1.,  1.,  1., -1.,  1.,
              1., -1.,  1.,  1.,  1.,  1., -1., -1.,  1.,  1.,  1., -1.,  1.,
              1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1.,  1.,  1.,  1.,  1.,  1., -1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1., -1.,  1., -1., -1.,
             -1., -1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1.,  1.,  1., -1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
              1.,  1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
             -1., -1.])
    • feedback_time
      (trial)
      float64
      2.028 0.9821 2.175 ... 2.331 2.316
      array([2.02844625, 0.98212378, 2.17533044, 0.91193783, 0.76863989,
             0.88239603, 0.95541056, 1.0227452 , 0.77146888, 0.59566791,
             1.01069795, 0.69147349, 0.80200783, 2.03664121, 0.70746159,
             1.9423001 , 0.79240452, 0.68427029, 1.09025943, 0.89700576,
             0.76313548, 1.61969069, 0.82400472, 0.62188998, 0.93538898,
             2.2110967 , 0.90388659, 0.93142791, 0.99482616, 2.31063777,
             1.15148331, 1.17060705, 1.96789847, 2.17597088, 0.83154933,
             0.74412959, 1.12479508, 0.71476968, 0.59562429, 0.76406939,
             0.79707056, 2.26466135, 0.82700402, 0.97828911, 0.74746335,
             1.16074863, 0.86804309, 0.86208002, 0.65305192, 0.73857827,
             0.63111674, 0.96324752, 1.30219889, 0.63136502, 0.9865111 ,
             1.07571279, 1.3148843 , 0.79693378, 0.96805532, 1.01017975,
             1.95742818, 2.12455172, 1.08060427, 0.8429947 , 2.24708145,
             0.81410002, 0.99880903, 0.92769301, 2.32197778, 0.67145082,
             0.81723941, 0.74856877, 2.07302823, 0.87348755, 1.97709963,
             0.7114232 , 0.80969547, 0.98519665, 0.55265499, 0.69566986,
             0.77515224, 0.9030013 , 1.39272472, 2.24197061, 0.77339872,
             0.81546199, 0.87802006, 2.27746621, 0.60947197, 0.89837592,
             0.58950196, 1.1756827 , 1.60030601, 1.92771786, 1.80698067,
             0.72347873, 2.10595787, 0.57430038, 1.10986524, 2.07011297,
      ...
             0.54389863, 1.88129339, 2.20013275, 0.85931623, 0.87259268,
             0.79997832, 0.59861153, 0.65663152, 0.75779248, 0.77532988,
             1.05398211, 0.7607209 , 0.85347702, 0.94490323, 0.79779448,
             0.72512034, 0.84362863, 0.78270272, 0.85435235, 0.85580687,
             0.86307211, 0.71276701, 1.01015968, 0.95065141, 0.57065516,
             0.83460137, 0.74428945, 1.97391798, 0.66356012, 0.85256976,
             0.73917528, 0.83793766, 1.15901447, 0.70128616, 0.80376696,
             0.88791995, 0.69053885, 0.78633403, 0.75603174, 0.89536814,
             0.98941679, 0.77404959, 0.60659076, 0.82694688, 1.01507791,
             0.60617278, 0.87616544, 0.67506335, 0.75516747, 0.93555814,
             0.83042472, 0.7489077 , 0.95253372, 0.96237963, 0.73146882,
             0.54702642, 2.02205225, 0.97429454, 1.09134926, 1.02486254,
             1.12829546, 2.30638146, 0.75363592, 0.75843562, 0.83796314,
             0.83488831, 2.24395516, 0.62067614, 0.81196849, 0.89320206,
             0.70553901, 2.21972955, 0.65277965, 0.84296061, 0.84860562,
             2.22383677, 0.6502999 , 0.80052833, 0.60263009, 1.13616042,
             1.03055269, 0.75535661, 0.63848476, 1.13259685, 1.09517301,
             0.75367423, 0.69001545, 1.94274564, 1.97871699, 1.9261176 ,
             1.93168534, 2.30226405, 2.19467372, 2.08049057, 1.95179219,
             2.2978576 , 2.2056123 , 2.18123251, 2.33067521, 2.31563673])
    • response_type
      (trial)
      float64
      0.0 1.0 0.0 1.0 ... 0.0 0.0 0.0 0.0
      array([ 0.,  1.,  0.,  1., -1., -1., -1., -1.,  1., -1., -1., -1.,  1.,
              0., -1.,  0.,  1.,  1.,  1.,  1.,  1., -1.,  1., -1., -1.,  0.,
              1.,  1., -1.,  0.,  1., -1.,  0.,  0., -1., -1., -1.,  1.,  1.,
              1., -1.,  0.,  1., -1., -1.,  1.,  1., -1.,  1., -1., -1.,  1.,
             -1., -1., -1.,  1.,  1., -1., -1., -1.,  0.,  0., -1.,  1.,  0.,
             -1., -1.,  1.,  0.,  1.,  1.,  1.,  0.,  1.,  0.,  1., -1.,  1.,
             -1.,  1.,  1.,  1., -1.,  0.,  1., -1., -1.,  0.,  1.,  1., -1.,
              1., -1.,  1., -1., -1.,  0., -1.,  1.,  0., -1., -1., -1.,  1.,
              1., -1.,  0.,  1.,  1.,  1.,  1., -1.,  0.,  1., -1.,  1.,  0.,
              0., -1., -1., -1., -1.,  0.,  1.,  0.,  0.,  1., -1., -1.,  0.,
             -1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  0.,  1., -1.,
             -1.,  1.,  1., -1.,  0., -1., -1.,  0.,  1.,  1.,  0.,  0.,  1.,
              0.,  1.,  1., -1.,  1., -1.,  1.,  1., -1.,  1.,  1.,  1.,  1.,
             -1.,  1.,  1., -1., -1., -1.,  0., -1.,  1.,  0., -1., -1., -1.,
             -1., -1., -1., -1.,  0.,  1., -1.,  0.,  1., -1., -1.,  1.,  1.,
              0., -1., -1., -1., -1., -1., -1., -1., -1.,  0., -1., -1., -1.,
              0.,  1., -1., -1., -1.,  0.,  1., -1.,  1., -1.,  0., -1., -1.,
              0., -1., -1., -1., -1.,  0.,  1.,  1.,  1.,  1.,  1., -1., -1.,
             -1.,  1., -1.,  1., -1.,  1.,  1., -1.,  0.,  1., -1.,  1., -1.,
              1., -1.,  1.,  1.,  1., -1.,  1., -1.,  1., -1.,  1.,  1.,  1.,
              1., -1., -1.,  1.,  1., -1.,  1.,  0.,  1., -1.,  1.,  1.,  1.,
             -1.,  1.,  1., -1., -1., -1.,  1.,  1.,  1.,  1., -1.,  1.,  1.,
             -1., -1.,  1.,  1.,  1.,  1., -1., -1.,  1.,  1.,  0.,  1.,  1.,
              1., -1.,  0., -1.,  1., -1., -1.,  0., -1.,  1.,  1.,  1.,  0.,
             -1., -1., -1.,  0.,  1., -1., -1.,  1.,  1.,  1., -1.,  1.,  1.,
              1., -1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
              0.,  0.])
    • response_time
      (trial)
      float64
      1.994 0.9578 2.138 ... 2.295 2.306
      array([1.99426527, 0.95784821, 2.13828994, 0.87558566, 0.73187312,
             0.84498881, 0.91654547, 0.98566059, 0.73437051, 0.55870603,
             0.97381392, 0.65443056, 0.76496615, 1.99861344, 0.69717263,
             1.90782541, 0.75634106, 0.64691274, 1.05597867, 0.85959097,
             0.74793423, 1.60253193, 0.78734453, 0.58528465, 0.89657513,
             2.17730963, 0.8661431 , 0.89468028, 0.98255584, 2.27701495,
             1.11504296, 1.15067443, 1.93374053, 2.14254996, 0.82498073,
             0.73844639, 1.08672525, 0.67962299, 0.55853275, 0.7271772 ,
             0.7612972 , 2.22838366, 0.78989897, 0.9412854 , 0.71047341,
             1.12491508, 0.83264104, 0.82441502, 0.61603847, 0.70217586,
             0.5938871 , 0.92564993, 1.26325309, 0.59484555, 0.95001222,
             1.0376979 , 1.27748152, 0.76045588, 0.92970015, 0.97624339,
             1.92232916, 2.08546263, 1.04363784, 0.80637394, 2.209491  ,
             0.77838648, 0.96074498, 0.90582358, 2.28713249, 0.63356728,
             0.77963291, 0.71269036, 2.03715526, 0.82215521, 1.94133653,
             0.67467712, 0.79800394, 0.94939761, 0.51683728, 0.65965808,
             0.76131893, 0.86712328, 1.37585016, 2.20608135, 0.73739738,
             0.77850511, 0.86735301, 2.24120719, 0.5741341 , 0.86094849,
             0.55243101, 1.14153706, 1.57143247, 1.87729226, 1.80298042,
             0.71884644, 2.069461  , 0.53683841, 1.07292909, 2.03215776,
      ...
             0.52362879, 1.87054572, 2.16177468, 0.81636561, 0.83117092,
             0.79000976, 0.55724164, 0.61635453, 0.71565233, 0.73397929,
             1.01303918, 0.71970345, 0.81127544, 0.90184159, 0.75698375,
             0.68244882, 0.80211181, 0.7415928 , 0.81370249, 0.81256594,
             0.82111043, 0.67258455, 0.96678393, 0.908359  , 0.52767569,
             0.79317278, 0.72630026, 1.93250738, 0.62124939, 0.80928339,
             0.69707211, 0.79462055, 1.11583598, 0.65981173, 0.76047097,
             0.84644233, 0.65017779, 0.74397819, 0.71454235, 0.85388649,
             0.94609935, 0.73065447, 0.56388706, 0.78523746, 0.97264326,
             0.5640558 , 0.83222747, 0.63183151, 0.71309095, 0.89205248,
             0.78638518, 0.70457151, 0.90943608, 0.92062316, 0.68839449,
             0.52130589, 1.98162408, 0.95002852, 1.04333385, 1.0122368 ,
             1.11553078, 2.26366949, 0.70898911, 0.71505432, 0.79597354,
             0.79139807, 2.20058939, 0.57604646, 0.76927839, 0.85013362,
             0.66284585, 2.17917761, 0.61053686, 0.79901128, 0.80658465,
             2.20667151, 0.60804973, 0.75789933, 0.55900911, 1.09273733,
             0.98716603, 0.71339825, 0.59294979, 1.0888625 , 1.05153662,
             0.70942652, 0.6462287 , 1.91592555, 1.95433213, 1.91152244,
             1.92020941, 2.26689046, 2.18762097, 2.0311148 , 1.93657994,
             2.27564445, 2.18505566, 2.16434573, 2.29520667, 2.30594758])
    • reaction_type
      (trial)
      float64
      1.0 -1.0 -1.0 -1.0 ... 0.0 0.0 0.0
      array([ 1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,  1.,
             -1., -1.,  0.,  1., -1., -1.,  1.,  1., -1., -1., -1.,  1.,  1.,
              1.,  1., -1.,  0.,  1., -1.,  0., -1.,  1., -1., -1.,  1.,  1.,
              1., -1.,  1.,  1., -1.,  1.,  1.,  1., -1.,  1., -1., -1.,  1.,
             -1., -1., -1.,  1.,  1., -1., -1., -1., -1., -1., -1.,  1., -1.,
             -1., -1.,  1.,  0.,  1.,  1., -1.,  0.,  1.,  0.,  1.,  1.,  1.,
             -1.,  1.,  1.,  1., -1.,  0.,  1., -1.,  1., -1.,  1.,  1.,  1.,
             -1., -1., -1.,  1., -1., -1., -1.,  1.,  0., -1., -1., -1.,  1.,
              1., -1., -1.,  1., -1.,  1., -1., -1., -1.,  1., -1.,  1.,  1.,
              0., -1., -1., -1., -1., -1.,  1., -1.,  1.,  1., -1., -1., -1.,
             -1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  0.,  1., -1.,
             -1.,  1.,  1., -1., -1., -1.,  1.,  1.,  1.,  1.,  0.,  0.,  1.,
             -1.,  1.,  1.,  1.,  1., -1.,  1., -1., -1.,  1.,  1.,  1.,  1.,
             -1.,  1.,  1., -1.,  1., -1.,  0., -1., -1., -1.,  1., -1., -1.,
             -1., -1., -1., -1.,  0., -1., -1.,  1.,  1., -1.,  1.,  1.,  1.,
             -1., -1., -1., -1., -1., -1., -1., -1., -1.,  1., -1.,  1., -1.,
              0.,  1., -1., -1.,  1.,  0.,  1., -1.,  1., -1.,  0.,  1., -1.,
             -1., -1., -1.,  1., -1., -1.,  1., -1.,  1.,  1.,  1., -1., -1.,
             -1.,  1., -1.,  1., -1.,  1.,  1., -1.,  0.,  1., -1.,  1., -1.,
              1., -1.,  1.,  1., -1., -1.,  1., -1.,  1., -1.,  1., -1.,  1.,
              1., -1.,  1.,  1.,  1., -1.,  1.,  0.,  1., -1.,  1.,  1., -1.,
             -1.,  1.,  1., -1., -1., -1.,  1.,  1.,  1.,  1., -1.,  1., -1.,
             -1., -1.,  1.,  1.,  1., -1., -1., -1.,  1.,  1.,  1., -1., -1.,
              1., -1.,  1., -1.,  1., -1., -1.,  0.,  1.,  1.,  1.,  1.,  0.,
             -1., -1., -1.,  1.,  1., -1., -1.,  1.,  1., -1., -1.,  1., -1.,
              1.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
              0.,  0.])
    • reaction_time
      (trial)
      float64
      740.0 160.0 730.0 ... inf inf inf
      array([ 740.,  160.,  730.,  210.,  160.,  220.,  170.,  130.,  100.,
              140.,  180.,  140.,  220.,  260.,  130.,   inf,  150.,   90.,
               50.,  220.,  120., 1430.,  340.,  220.,  140.,   80.,  210.,
              190.,  130.,   inf,  130.,  480.,   inf,  210.,  210.,  220.,
              180.,  110.,  200.,  180.,  210.,   60.,  130.,  140.,  140.,
              120.,  160.,  150.,  200.,  110.,  140.,  190.,  110.,  190.,
              190.,  180.,  150.,  170.,  130.,   10., 1940.,   80.,  190.,
              230., 1040.,   90.,  190.,  130.,   inf,  130.,  180.,   70.,
               inf,  100.,   inf,  190.,  150.,  240.,  120.,    0.,  240.,
              180., 1220.,   inf,  220.,  210.,  280.,  480.,  240.,  190.,
              220.,  120., 1390.,  320.,  100.,  420.,  460.,  140.,  160.,
               inf,  300.,  170.,  160.,  160.,  250.,  510.,  750.,  150.,
                0.,  160.,   10.,   20.,  240.,  470.,  750.,  780., 1390.,
               inf,  170.,  160.,  240., 1400.,  310.,  180.,  690.,  460.,
              270.,   20.,  580.,  390.,  150.,  190.,  290.,   40.,  460.,
              150.,  680.,  130.,  180.,  460.,   inf,  240.,  220.,  230.,
              160.,  210., 1190.,  740.,   90.,  110.,  270.,  190.,  210.,
               inf,   inf,  170., 1540.,   90.,  140.,   60.,  200.,  180.,
              170.,  200.,  200.,  150.,  180.,   40.,  220.,  200.,   10.,
              270.,  190.,   10.,  150.,   inf,  210., 1750.,  320.,  330.,
              630.,  650.,  860.,  290., 1800., 1220.,   inf,  140.,  170.,
              140.,  140.,  130.,   10.,  110.,  620.,  310.,  220.,  130.,
              100.,   80.,  370.,  970.,  140., 1960.,  500.,  180.,  290.,
             1030.,   inf,  230.,  180.,  210.,  210.,   inf,  230.,  250.,
              220.,  260.,   inf,   70.,  130.,  450.,  190.,  500.,  330.,
              420.,  810.,  170.,  180.,  160.,  200.,  200.,  190.,  330.,
              140.,  230.,   20.,  260.,  250.,  200.,  380.,  830.,   inf,
              270.,  200.,  230.,  200.,  310.,  170.,   60.,  140.,   80.,
               70.,  220.,  300.,  200.,  230.,  190.,   30.,  120.,  190.,
              110.,   60.,  200.,  300.,  140.,  110.,   inf,  210.,   60.,
              210.,  160.,   60.,  280.,   80.,  220.,  230.,  570.,  140.,
              280.,  200.,  170.,  240.,  190.,  220.,   80.,  180.,  190.,
               80.,   40.,  240.,   30.,  250.,  260.,  210.,  380.,   80.,
              590.,  160.,  880.,  830., 1930.,  250.,  190.,  190.,  340.,
               inf,  110.,  180.,  240.,  180.,   inf,  150.,  210.,  190.,
              220.,  240.,  240.,  270.,  190.,  330.,   50.,  250.,  250.,
              800.,  320.,  230.,   inf,   inf,   inf,   inf,   inf,   inf,
               inf,   inf,   inf,   inf,   inf,   inf,   inf])
    • prev_reward
      (trial)
      float64
      -10.0 -1.653 ... -2.555 -2.605
      array([-10.        ,  -1.65250471,  -3.21064213,  -4.34159707,
              -2.88497802,  -5.48768515,  -2.55005972,  -3.31419783,
              -2.54887547,  -3.49070394,  -2.07631951,  -2.2114628 ,
              -1.9854853 ,  -2.26567782,  -1.33820307,  -2.67047226,
              -2.16532347,  -1.7358368 ,  -3.0631728 ,  -2.35453356,
              -3.25195151,  -2.2803811 ,  -2.61241622,  -2.66482936,
              -1.75326478,  -1.96339219,  -1.54274463,  -2.13837082,
              -2.0507763 ,  -3.82214317,  -1.68539066,  -1.63268379,
              -2.39451289,  -1.99626213,  -1.30751022,  -2.56089904,
              -2.39655204,  -2.30335447,  -2.32477501,  -1.87306965,
              -2.92188852,  -3.11360868,  -3.21734641,  -3.04208824,
              -1.95638906,  -1.47468879,  -1.55063406,  -1.4417636 ,
              -3.50068775,  -1.61447759,  -1.92253169,  -3.19125681,
              -1.41944771,  -3.72165901,  -1.80005857,  -1.39523062,
              -6.22246591,  -1.37250811,  -2.37048267,  -1.43981954,
              -5.36863979,  -6.73790642,  -4.82459086,  -3.97645835,
              -2.23881996,  -2.40634839,  -2.25616311,  -1.39401287,
              -3.68479983,  -1.97744222,  -1.93669372,  -1.820284  ,
              -3.39294841,  -2.04763804,  -2.39271102,  -1.57438113,
              -2.23510542,  -2.21655297,  -2.01639036,  -2.19019984,
      ...
              -1.41220972,  -3.29326663,  -1.58326945,  -2.27478228,
              -3.00570149,  -5.05688383,  -3.45641459,  -2.69215543,
              -1.45388859,  -3.09021178,  -1.22014634,  -3.23743871,
              -1.68435373,  -1.25592753,  -1.89015591,  -1.27021484,
              -1.48297789,  -1.489268  ,  -5.75164088,  -6.22944912,
              -1.6373121 ,  -1.56930998,  -3.9688865 ,  -1.8142043 ,
              -2.27749068,  -1.8375058 ,  -1.46599366,  -2.16892571,
              -2.48652259,  -2.15737397,  -1.66352576,  -2.47918982,
              -1.78905171,  -1.23075744,  -3.44436265,  -3.81172616,
              -2.49454967,  -1.87258484,  -3.04019128,  -3.93724185,
              -3.76801871,  -2.40006824,  -2.06032663,  -2.80107509,
              -2.62068027,  -6.10842589,  -5.12406727,  -1.59872953,
              -2.48072031,  -2.44954809,  -1.35476648,  -2.0622405 ,
              -4.91387224,  -3.10055301,  -1.79259116,  -3.6030888 ,
              -4.09935108,  -2.09217383,  -2.34085181,  -1.50670805,
              -2.31293046,  -4.65252711,  -2.8067355 ,  -1.77779038,
              -1.28100405,  -2.25881627,  -1.96948004,  -6.99840149,
              -2.26497959,  -2.22514214,  -2.23698518,  -9.73182829,
              -2.45918355,  -2.21103988,  -2.21445828,  -2.5346419 ,
              -2.49788566,  -2.59061019,  -2.55549975,  -2.60512028])
    • active_trials
      (trial)
      bool
      True True True ... True True True
      array([ True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True,  True,  True,
              True,  True,  True,  True,  True,  True,  True])
    • wheel
      (trial, time)
      int8
      0 0 -1 0 0 -1 0 ... 1 0 -1 -2 -2 -2
      array([[ 0,  0, -1, ...,  0,  0,  0],
             [-1, -1, -1, ...,  0,  0,  0],
             [ 0,  0,  0, ...,  0,  0,  0],
             ...,
             [ 0,  0,  0, ...,  0,  0,  0],
             [ 0,  0,  0, ...,  0,  0,  0],
             [ 0,  0,  0, ..., -2, -2, -2]], dtype=int8)
    • licks
      (trial, time)
      int8
      0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0
      array([[0, 0, 0, ..., 0, 0, 0],
             [0, 0, 0, ..., 0, 0, 0],
             [0, 0, 0, ..., 0, 0, 0],
             ...,
             [0, 0, 0, ..., 0, 0, 0],
             [0, 0, 0, ..., 0, 0, 0],
             [0, 0, 0, ..., 0, 0, 0]], dtype=int8)
    • pupil_x
      (trial, time)
      float64
      -0.03687 -0.06081 ... -0.6049
      array([[-0.03687325, -0.06080917, -0.09111937, ...,  0.18874694,
               0.21005926,  0.13812765],
             [ 0.27035386,  0.41271519,  0.57465343, ..., -0.15011777,
               0.09788839,  0.31645547],
             [ 0.05982958,  0.24078953,  0.30618341, ...,  0.26449726,
               0.34041753,  0.46878237],
             ...,
             [-0.28792338, -0.45475543, -0.68214447, ..., -0.56089523,
              -0.74167388, -0.69821645],
             [-0.57530686, -0.64454211, -0.50760033, ..., -0.68730709,
              -0.49327275, -0.43123595],
             [-0.92819876, -1.00284926, -0.8915857 , ..., -0.8400229 ,
              -0.71173101, -0.60486285]])
    • pupil_y
      (trial, time)
      float64
      -0.7333 -0.6722 ... -0.8551 -0.6559
      array([[-0.73330929, -0.67215452, -0.69929956, ..., -0.48343186,
              -0.553119  , -0.33521189],
             [-0.61031102, -0.61433116, -0.6945977 , ..., -0.21308693,
              -0.38743376, -0.45208842],
             [ 0.52273196,  0.4997616 ,  0.3911043 , ...,  0.76265024,
               0.60712037,  0.71520343],
             ...,
             [-1.54045432, -1.43085199, -1.3787897 , ..., -1.1521952 ,
              -1.29758356, -1.27988791],
             [-1.00602112, -0.90223187, -0.81425065, ..., -0.40731512,
              -0.49983651, -0.42592426],
             [-0.55938251, -0.42983043, -0.5606555 , ..., -0.73331289,
              -0.85507582, -0.65585751]])
    • pupil_area
      (trial, time)
      float64
      0.07904 0.07208 ... 0.00741 0.01596
      array([[0.0790378 , 0.07208427, 0.08898566, ..., 0.04742573, 0.03847304,
              0.03930904],
             [0.07455263, 0.08073489, 0.07686962, ..., 0.03609075, 0.03387179,
              0.04783916],
             [0.03029546, 0.03232989, 0.03613245, ..., 0.03221604, 0.03299808,
              0.02791235],
             ...,
             [0.06048629, 0.06249252, 0.06813664, ..., 0.07211884, 0.07244322,
              0.0665155 ],
             [0.02274222, 0.02415935, 0.02242029, ..., 0.02580303, 0.02671467,
              0.02228576],
             [0.01973291, 0.0202247 , 0.02414676, ..., 0.01473611, 0.00740969,
              0.01595974]])
    • face
      (trial, time)
      float64
      1.32 1.32 1.32 ... 1.246 2.116
      array([[1.31961002, 1.31961002, 1.31961002, ..., 0.0502838 , 0.00434887,
              0.00434887],
             [2.21411806, 2.21411806, 2.0532099 , ..., 0.53219288, 0.53219288,
              0.63901198],
             [0.41178356, 0.41178356, 0.35008398, ..., 0.35225841, 0.35225841,
              0.72517395],
             ...,
             [0.66727963, 0.66727963, 0.83009042, ..., 0.70641945, 0.70641945,
              0.57106089],
             [0.22559759, 0.22559759, 0.2386442 , ..., 0.01331841, 0.01331841,
              0.01359022],
             [0.2386442 , 0.2386442 , 0.17531379, ..., 1.24622285, 1.24622285,
              2.11572489]])
    • spike_count
      (cell, trial, time)
      int8
      0 1 0 0 0 0 0 0 ... 0 0 0 0 1 0 0 0
      array([[[0, 1, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              ...,
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0]],
             [[0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              ...,
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0]],
             [[0, 0, 1, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              ...,
      ...
              ...,
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0]],
             [[0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              ...,
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0]],
             [[0, 0, 0, ..., 1, 0, 0],
              [0, 0, 0, ..., 1, 0, 0],
              [1, 0, 0, ..., 0, 1, 0],
              ...,
              [0, 0, 0, ..., 0, 0, 0],
              [0, 1, 0, ..., 0, 0, 0],
              [0, 0, 0, ..., 0, 0, 0]]], dtype=int8)
    • trough_to_peak
      (cell)
      int8
      24 20 23 17 19 ... 17 20 20 20 13
      array([24, 20, 23, 17, 19, 22, 18, 22, 19, 12, 17,  8, 17, 19, 17, 14, 17,
             19, 12, 18, 15, 23, 19, 18, 25, 21, 22, 13, 20, 15, 19, 12, 18, 17,
             14, 20, 17, 21, 24, 20, 17,  9,  8, 16, 15, 10, 17, 18, 18, 18, 25,
             14, 17, 19, 18, 18, 16, 15, 17, 23, 17, 13, 14, 17, 11, 20, 15, 24,
             15, 20, 17,  8, 18, 16, 14, 17, 20, 18, 27, 12, 16, 17, 19, 19, 16,
             18, 16, 18, 13, 24, 23, 18, 19, 18, 19, 12, 19, 15, 18, 17, 11, 15,
             16, 17, 16, 11, 20, 14, 19, 25, 20, 19, 20, 15,  5,  5, 18, 17, 20,
             16, 18, 21, 17, 17, 17, 18, 16, 15, 18,  9, 14, 19, 17,  7, 18, 18,
             24,  6,  8, 13, 18,  5,  5, 10, 12, 15, 19, 16, 16, 17, 17, 15, 19,
             15,  6, 15, 24, 18, 10,  8, 16, 17, 19, 18, 15, 15, 22, 10, 18, 22,
             16,  8, 15, 21, 12, 17, 12, 18,  9,  8, 19, 19, 11, 19, 22, 16, 19,
             18, 31, 17, 16, 18, 18, 17, 24, 13, 20, 15, 13, 20, 19, 15, 17, 19,
             18, 25, 17, 17, 19, 11, 21, 18, 20, 18, 17, 18,  8, 15, 15, 16, 16,
             25, 17, 20, 14, 17, 22, 14, 23, 19, 23, 18, 24, 17,  7, 16, 21, 14,
              9, 19, 19, 24, 14, 15, 17, 19, 14, 22, 15, 23, 17, 17, 23, 18, 18,
             18, 13, 17, 18, 21, 12, 18, 16, 17, 26, 14, 21, 24, 23, 20, 21, 24,
             22, 20, 22, 29, 20, 14, 23, 28, 14, 15, 17, 15, 13, 17, 23, 18, 17,
             13, 14, 17, 20, 13, 17, 18, 24, 14, 15, 24, 23, 13, 19, 21, 21, 22,
             19, 14, 12, 18, 22, 18, 13, 13, 16, 17, 13, 19, 18, 27, 29, 20, 13,
             13, 14, 16, 13, 14, 23, 13, 13, 13, 13, 18, 13, 17,  7, 25, 18, 13,
      ...
             28, 23,  8, 16, 25, 13, 20, 12, 21, 24, 18, 26, 13, 21, 20, 14, 23,
             13, 20, 25, 26, 12, 14, 22, 24, 21, 26, 13, 20, 13, 18, 15, 13, 20,
             14, 15, 15, 22, 22, 19, 22, 17, 14, 15, 15, 18, 15, 18, 23, 19, 13,
             19, 23, 14, 18, 17, 17, 16, 22, 16, 20, 16, 16, 17, 29, 20, 16, 20,
             22,  5, 12, 17, 17, 19, 16, 16, 14, 20, 14,  7, 42, 25, 16, 13, 18,
             17, 25, 17, 21, 17, 21, 12, 15, 15, 23,  9, 16,  7, 15, 17, 12, 16,
             23, 19, 17, 15, 20, 18, 10, 19, 15, 17, 21, 26, 13, 16, 17, 16, 21,
             27, 16, 28, 41, 15,  9, 17, 19, 11, 21, 15, 17, 18, 20, 24, 25, 23,
             20, 20, 10, 34, 17, 19, 17, 13, 14, 18,  8, 20, 16,  9, 27, 21, 20,
             16, 18, 17, 14, 17, 29, 14, 16, 19, 22, 12,  8, 16, 17, 17, 13, 18,
             15, 14, 20, 25, 21,  7, 16, 10, 16, 22, 13, 16, 18, 24, 25, 22, 22,
             18,  7, 22, 33, 17,  8, 17, 15, 15, 20, 34, 15, 18, 14, 19, 15, 19,
             17, 14, 17, 25, 22, 23, 15, 13, 28, 15, 15, 13, 20, 17, 18,  7, 18,
              8, 16, 14, 10,  9, 16, 20, 16,  7,  9, 11, 17, 17, 19, 15, 19, 16,
             14, 15, 11, 10, 15, 16,  6, 15, 22, 13, 16, 15, 19, 12, 15, 16, 19,
              8, 14, 18, 14, 21, 10, 14, 20, 16, 17, 17, 14, 21, 16, 14, 24, 16,
              9, 17, 15, 14, 18, 19, 31, 18, 28, 21, 14, 18, 20, 14, 16, 29, 22,
             13, 16, 18, 19, 16, 17, 17, 32, 18, 15, 17, 15, 21, 22, 14, 15, 15,
             24, 30, 13, 19, 23, 20, 17, 20, 28, 15, 27, 15, 15, 17, 20, 20, 20,
             13], dtype=int8)
    • ccf_ap
      (cell)
      float64
      9.07e+03 8.92e+03 ... 6.41e+03
      array([9069.9, 8919.6, 9096.6, 8073.8, 8968.9, 9276.7, 8574.3, 8111.4,
             8889.8, 8975.9, 8607.9, 8243. , 9156.9, 9021.4, 8555.5, 8975.9,
             8975.9, 8889.8, 8555.5, 8611.8, 8205.4, 9077.8, 8547.6, 8882. ,
             8875. , 9265.7, 8111.4, 9051.1, 8566.4, 8600.1, 8499.1, 8524.9,
             8566.4, 8581.3, 8476.4, 8979.9, 8919.6, 8581.3, 9213.2, 8055.1,
             8574.3, 8908.6, 8273.6, 8536.7, 8562.5, 7687. , 8555.5, 8983.8,
             8889.8, 8555.5, 8574.3, 8975.9, 8536.7, 8562.5, 8036.3, 9115.4,
             8536.7, 8224.2, 9096.6, 8882. , 8593.1, 8938.4, 7668.2, 9100.5,
             8160.8, 8532.7, 8656.5, 8040.2, 8656.5, 8055.1, 9096.6, 7641.6,
             8547.6, 8570.3, 8123.2, 8562.5, 8600.1, 8600.1, 8077.8, 7687. ,
             8574.3, 8555.5, 8506.1, 8547.6, 8593.1, 8607.9, 8536.7, 8055.1,
             8975.9, 9107.5, 8581.3, 8547.6, 8547.6, 9149. , 8562.5, 8852.2,
             8292.4, 8536.7, 8555.5, 8430.9, 8987.7, 8562.5, 8555.5, 8506.1,
             8010.4, 8637.7, 9100.5, 8167.8, 8524.9, 9107.5, 8957.2, 8547.6,
             8600.1, 8506.1, 8637.7, 8611.8, 8547.6, 8536.7, 9107.5, 8562.5,
             9013.5, 9265.7, 9111.4, 8908.6, 8574.3, 8574.3, 8213.3, 8194.5,
             9111.4, 9077.8, 7829.5, 8547.6, 8562.5, 9013.5, 8055.1, 9115.4,
             9276.7, 8938.4, 7626.7, 7916.5, 8585.2, 8957.2, 8630.6, 8081.7,
             8524.9, 8630.6, 8611.8, 8600.1, 8618.9, 8100.5, 9088.7, 8574.3,
             8593.1, 8618.9, 7709.7, 8111.4, 8788. , 8562.5, 7679.2, 8288.4,
      ...
             6344.2, 6366.3, 6444.2, 7101.5, 7361.5, 7361.5, 6366.3, 6609.4,
             6355.2, 7261.5, 6858.9, 6444.2, 6505.2, 7173.1, 7228.3, 6399.4,
             7095.7, 6543.6, 7322.5, 6538.4, 7135.2, 6350. , 7372. , 7145.7,
             6405.8, 6892. , 7350.4, 7162. , 6421.5, 6476.8, 6388.4, 6521. ,
             6394.7, 6443.6, 6405.8, 6537.8, 6355.2, 7239.9, 7057.3, 6548.9,
             6455.2, 7228.8, 7084.6, 6405.8, 6421.5, 7422.5, 7228.3, 6582.6,
             6388.4, 7151.5, 6450. , 6914.1, 6875.2, 6372.1, 7046.7, 6670.5,
             6399.4, 6621. , 6704.1, 6682. , 6643.1, 6704.1, 6676.3, 6444.2,
             7334.1, 6421.5, 6438.9, 6472.1, 6427.9, 6494.2, 6852.6, 6653.6,
             6421.5, 6626.8, 6903.1, 6366.3, 7300.4, 6996.2, 6394.2, 6366.3,
             6483.1, 6642.6, 6399.4, 6476.8, 7272.5, 7162. , 6461. , 7305.7,
             6394.7, 7316.7, 6830.5, 6383.7, 7345.1, 7228.3, 6427.9, 6527.3,
             6410.5, 7267.8, 6510.5, 6416.8, 7272.5, 6498.9, 6819.4, 6443.6,
             6465.8, 6416.8, 6886.2, 6450. , 7135.2, 7073.6, 7212.5, 6510.5,
             6421.5, 7334.1, 7095.7, 7400.4, 6355.2, 7029.4, 6465.8, 6847.3,
             6576.3, 6516.3, 7323. , 6394.7, 6355.2, 7283.6, 7095.7, 6505.2,
             6394.7, 6355.2, 7135.2, 7360.9, 7135.2, 7068.3, 6432.6, 6355.2,
             6465.8, 7073.6, 6444.2, 7345.1, 7118.3, 7294.6, 7261.5, 7073.6,
             7051.5, 6394.7, 7118.3, 6405.8, 6355.2, 6444.2, 7367.2, 7338.8,
             7073.6, 6410.5])
    • ccf_dv
      (cell)
      float64
      1.104e+03 1.381e+03 ... 3.57e+03
      array([1103.5, 1380.7, 1034.3, 2939.5, 1259.4,  722.5, 1986.9, 2870.2,
             1415.3, 1276.7, 1934.9, 2627.7,  913. , 1172.8, 2021.5, 1276.7,
             1276.7, 1415.3, 2021.5, 1917.6, 2697. , 1068.9, 2056.2, 1449.9,
             1432.6,  722.5, 2870.2, 1138.2, 2021.5, 1969.6, 2125.4, 2108.1,
             2021.5, 2004.2, 2177.4, 1259.4, 1380.7, 2004.2,  809.1, 2974.2,
             1986.9, 1380.7, 2541.1, 2056.2, 2038.8, 3632.3, 2021.5, 1242.1,
             1415.3, 2021.5, 1986.9, 1276.7, 2056.2, 2038.8, 3008.8,  999.6,
             2056.2, 2662.4, 1034.3, 1449.9, 1952.2, 1346. , 3667. , 1016.9,
             2749. , 2073.5, 1865.6, 2991.5, 1865.6, 2974.2, 1034.3, 3736.3,
             2056.2, 2004.2, 2818.3, 2038.8, 1969.6, 1969.6, 2922.2, 3632.3,
             1986.9, 2021.5, 2142.8, 2056.2, 1952.2, 1934.9, 2056.2, 2974.2,
             1276.7, 1034.3, 2004.2, 2056.2, 2056.2,  947.7, 2038.8, 1484.6,
             2506.5, 2056.2, 2021.5, 2281.3, 1224.8, 2038.8, 2021.5, 2142.8,
             3026.1, 1900.3, 1016.9, 2766.3, 2108.1, 1034.3, 1311.4, 2056.2,
             1969.6, 2142.8, 1900.3, 1917.6, 2056.2, 2056.2, 1034.3, 2038.8,
             1207.5,  722.5, 1016.9, 1380.7, 1986.9, 1986.9, 2662.4, 2697. ,
             1016.9, 1068.9, 3389.8, 2056.2, 2038.8, 1207.5, 2974.2,  999.6,
              722.5, 1346. , 3753.6, 3199.3, 1986.9, 1311.4, 1883. , 2904.9,
             2108.1, 1883. , 1917.6, 1969.6, 1934.9, 2870.2, 1068.9, 1986.9,
             1952.2, 1934.9, 3580.4, 2870.2, 1623.2, 2038.8, 3667. , 2523.8,
      ...
             3791.1, 3717.5, 3533.4, 1305.7,  477.3,  477.3, 3717.5, 2907.4,
             3754.3,  735. , 2189.4, 3533.4, 3367.7, 1029.6,  845.5, 3607. ,
             1287.3, 3202. ,  569.3, 3257.2, 1268.9, 3809.5,  366.8, 1158.5,
             3699. , 2079. ,  514.1, 1066.4, 3533.4, 3349.3, 3643.8, 3202. ,
             3735.9, 3459.7, 3699. , 3183.6, 3754.3,  882.3, 1453. , 3146.7,
             3496.5,  919.1, 1324.1, 3699. , 3533.4,  311.6,  845.5, 3109.9,
             3643.8, 1176.9, 3551.8, 2005.3, 2097.4, 3735.9, 1563.5, 2741.7,
             3607. , 2944.2, 2704.9, 2778.5, 2870.6, 2704.9, 2760.1, 3533.4,
              606.2, 3533.4, 3588.6, 3478.1, 3625.4, 3404.5, 2097.4, 2760.1,
             3533.4, 2962.6, 2042.1, 3717.5,  643. , 1618.7, 3662.2, 3717.5,
             3441.3, 2797. , 3607. , 3349.3,  698.2, 1066.4, 3514.9,  587.7,
             3735.9,  550.9, 2171. , 3772.7,  569.3,  845.5, 3625.4, 3294. ,
             3570.2,  827.1, 3312.4, 3662.2,  698.2, 3275.6, 2207.8, 3459.7,
             3386.1, 3662.2, 2060.5, 3551.8, 1268.9, 1361. , 1011.2, 3312.4,
             3533.4,  606.2, 1287.3,  385.2, 3754.3, 1508.2, 3386.1, 2152.6,
             3017.9, 3330.8,  643. , 3735.9, 3754.3,  661.4, 1287.3, 3367.7,
             3735.9, 3754.3, 1268.9,  403.6, 1268.9, 1416.2, 3496.5, 3754.3,
             3386.1, 1361. , 3533.4,  569.3, 1287.3,  624.6,  735. , 1361. ,
             1434.6, 3735.9, 1287.3, 3699. , 3754.3, 3533.4,  495.7,  477.3,
             1361. , 3570.2])
    • ccf_lr
      (cell)
      float64
      3.854e+03 3.8e+03 ... 4.956e+03
      array([3854.3, 3799.6, 3898.1, 3491.8, 3868.6, 3929.6, 3725. , 3505.5,
             3822.8, 3820.1, 3720.2, 3553.3, 3937. , 3870.7, 3718.2, 3820.1,
             3820.1, 3822.8, 3718.2, 3738.7, 3539.7, 3891.2, 3681.2, 3785.9,
             3834.4, 3959.6, 3505.5, 3847.5, 3688.1, 3683.3, 3697.6, 3655.9,
             3688.1, 3676.5, 3672.3, 3838.6, 3799.6, 3676.5, 3957.6, 3484.9,
             3725. , 3829.7, 3615.5, 3711.3, 3669.6, 3385. , 3718.2, 3857. ,
             3822.8, 3718.2, 3725. , 3820.1, 3711.3, 3669.6, 3478.1, 3904.9,
             3711.3, 3546.5, 3898.1, 3785.9, 3731.8, 3806.4, 3378.2, 3916.5,
             3574.5, 3692.9, 3703.8, 3496.6, 3703.8, 3484.9, 3898.1, 3334.4,
             3681.2, 3706.5, 3560.8, 3669.6, 3683.3, 3683.3, 3510.2, 3385. ,
             3725. , 3718.2, 3649.1, 3681.2, 3731.8, 3720.2, 3711.3, 3484.9,
             3820.1, 3868. , 3676.5, 3681.2, 3681.2, 3900.1, 3669.6, 3809.1,
             3622.4, 3711.3, 3718.2, 3621.7, 3875.5, 3669.6, 3718.2, 3649.1,
             3519.8, 3697. , 3916.5, 3526. , 3655.9, 3868. , 3813.3, 3681.2,
             3683.3, 3649.1, 3697. , 3738.7, 3681.2, 3711.3, 3868. , 3669.6,
             3833.8, 3959.6, 3886.5, 3829.7, 3725. , 3725. , 3576.6, 3569.7,
             3886.5, 3891.2, 3402.9, 3681.2, 3669.6, 3833.8, 3484.9, 3904.9,
             3929.6, 3806.4, 3346.1, 3485.6, 3694.9, 3813.3, 3745.5, 3528.7,
             3655.9, 3745.5, 3738.7, 3683.3, 3690.2, 3535.5, 3861.2, 3725. ,
             3731.8, 3690.2, 3410.3, 3505.5, 3751.7, 3669.6, 3348.1, 3603.9,
      ...
             5021.9, 4999.8, 4967.1, 4287.2, 4049.9, 4049.9, 4999.8, 4756.6,
             5010.8, 4104.6, 4575.1, 4967.1, 4928.7, 4193. , 4137.8, 4966.6,
             4270.4, 4867.7, 4066.2, 4895.6, 4298.8, 5038.7, 3994.1, 4243. ,
             5028.2, 4541.9, 4060.9, 4204.1, 4944.5, 4889.3, 4977.7, 4845. ,
             5039.2, 4922.4, 5028.2, 4850.8, 5010.8, 4171.4, 4331.4, 4839.8,
             4956.1, 4182.5, 4281.4, 5028.2, 4944.5, 4011.4, 4137.8, 4851.4,
             4977.7, 4259.8, 4984. , 4519.8, 4536.1, 5016.6, 4387.2, 4718.2,
             4966.6, 4790.3, 4729.8, 4751.9, 4768.2, 4729.8, 4735.1, 4967.1,
             4099.9, 4944.5, 4995. , 4961.9, 5006.1, 4939.8, 4513.5, 4712.4,
             4944.5, 4807.2, 4530.9, 4999.8, 4088.3, 4369.8, 4994.5, 4999.8,
             4950.8, 4723.5, 4966.6, 4889.3, 4093.5, 4204.1, 4972.9, 4060.4,
             5039.2, 4049.3, 4535.6, 5050.3, 4088.8, 4137.8, 5006.1, 4906.6,
             4955.6, 4166.2, 4900.8, 5017.1, 4093.5, 4867.2, 4546.7, 4922.4,
             4900.3, 5017.1, 4525.1, 4984. , 4298.8, 4292.5, 4221.4, 4900.8,
             4944.5, 4099.9, 4270.4, 4033.5, 5010.8, 4336.7, 4900.3, 4541.4,
             4789.8, 4917.7, 4110.9, 5039.2, 5010.8, 4082.5, 4270.4, 4928.7,
             5039.2, 5010.8, 4298.8, 4005.1, 4298.8, 4320.4, 4933.5, 5010.8,
             4900.3, 4292.5, 4967.1, 4088.8, 4293. , 4071.4, 4104.6, 4292.5,
             4314.6, 5039.2, 4293. , 5028.2, 5010.8, 4967.1, 4066.7, 4027.2,
             4292.5, 4955.6])
    • brain_area
      (cell)
      <U5
      'VISp' 'VISp' 'VISp' ... 'CA1' 'MD'
      array(['VISp', 'VISp', 'VISp', 'DG', 'VISp', 'VISp', 'SUB', 'DG', 'VISp',
             'VISp', 'SUB', 'DG', 'VISp', 'VISp', 'SUB', 'VISp', 'VISp', 'VISp',
             'SUB', 'SUB', 'DG', 'VISp', 'SUB', 'VISp', 'VISp', 'VISp', 'DG',
             'VISp', 'SUB', 'SUB', 'SUB', 'SUB', 'SUB', 'SUB', 'SUB', 'VISp',
             'VISp', 'SUB', 'VISp', 'DG', 'SUB', 'VISp', 'DG', 'SUB', 'SUB',
             'LGd', 'SUB', 'VISp', 'VISp', 'SUB', 'SUB', 'VISp', 'SUB', 'SUB',
             'DG', 'VISp', 'SUB', 'DG', 'VISp', 'VISp', 'SUB', 'VISp', 'LGd',
             'VISp', 'DG', 'SUB', 'SUB', 'DG', 'SUB', 'DG', 'VISp', 'LGd',
             'SUB', 'SUB', 'DG', 'SUB', 'SUB', 'SUB', 'DG', 'LGd', 'SUB', 'SUB',
             'SUB', 'SUB', 'SUB', 'SUB', 'SUB', 'DG', 'VISp', 'VISp', 'SUB',
             'SUB', 'SUB', 'VISp', 'SUB', 'VISp', 'DG', 'SUB', 'SUB', 'SUB',
             'VISp', 'SUB', 'SUB', 'SUB', 'DG', 'SUB', 'VISp', 'DG', 'SUB',
             'VISp', 'VISp', 'SUB', 'SUB', 'SUB', 'SUB', 'SUB', 'SUB', 'SUB',
             'VISp', 'SUB', 'VISp', 'VISp', 'VISp', 'VISp', 'SUB', 'SUB', 'DG',
             'DG', 'VISp', 'VISp', 'LGd', 'SUB', 'SUB', 'VISp', 'DG', 'VISp',
             'VISp', 'VISp', 'LGd', 'DG', 'SUB', 'VISp', 'SUB', 'DG', 'SUB',
             'SUB', 'SUB', 'SUB', 'SUB', 'DG', 'VISp', 'SUB', 'SUB', 'SUB',
             'LGd', 'DG', 'SUB', 'SUB', 'LGd', 'DG', 'SUB', 'SUB', 'SUB', 'SUB',
             'DG', 'SUB', 'DG', 'SUB', 'SUB', 'SUB', 'SUB', 'LGd', 'SUB',
             'VISp', 'SUB', 'SUB', 'SUB', 'SUB', 'LGd', 'DG', 'VISp', 'VISp',
      ...
             'DG', 'VISam', 'MD', 'DG', 'MD', 'DG', 'VISam', 'CA1', 'VISam',
             'VISam', 'MD', 'MD', 'VISam', 'MD', 'MD', 'CA1', 'LH', 'MD',
             'VISam', 'VISam', 'VISam', 'DG', 'MD', 'MD', 'MD', 'CA1', 'VISam',
             'MD', 'MD', 'MD', 'CA1', 'VISam', 'VISam', 'MD', 'LH', 'MD',
             'VISam', 'DG', 'MD', 'MD', 'VISam', 'VISam', 'MD', 'CA1', 'MD',
             'VISam', 'MD', 'CA1', 'MD', 'VISam', 'CA1', 'MD', 'DG', 'VISam',
             'VISam', 'MD', 'MD', 'MD', 'MD', 'MD', 'MD', 'MD', 'MD', 'MD',
             'VISam', 'CA1', 'MD', 'MD', 'VISam', 'CA1', 'MD', 'MD', 'VISam',
             'VISam', 'MD', 'MD', 'CA1', 'MD', 'DG', 'DG', 'MD', 'CA1', 'LH',
             'MD', 'LH', 'LH', 'LH', 'LH', 'LH', 'LH', 'MD', 'VISam', 'MD',
             'MD', 'MD', 'MD', 'MD', 'DG', 'LH', 'MD', 'LH', 'DG', 'MD',
             'VISam', 'CA1', 'MD', 'MD', 'MD', 'LH', 'MD', 'MD', 'VISam',
             'VISam', 'MD', 'VISam', 'MD', 'VISam', 'DG', 'MD', 'VISam',
             'VISam', 'MD', 'MD', 'MD', 'VISam', 'MD', 'MD', 'VISam', 'MD',
             'DG', 'MD', 'MD', 'MD', 'DG', 'MD', 'CA1', 'CA1', 'VISam', 'MD',
             'MD', 'VISam', 'CA1', 'VISam', 'MD', 'CA1', 'MD', 'DG', 'LH', 'MD',
             'VISam', 'MD', 'MD', 'VISam', 'CA1', 'MD', 'MD', 'MD', 'CA1',
             'VISam', 'CA1', 'CA1', 'MD', 'MD', 'MD', 'CA1', 'MD', 'VISam',
             'CA1', 'VISam', 'VISam', 'CA1', 'CA1', 'MD', 'CA1', 'MD', 'MD',
             'MD', 'VISam', 'VISam', 'CA1', 'MD'], dtype='<U5')
    • brain_groups
      (cell)
      <U17
      'visual cortex' ... 'thalamus'
      array(['visual cortex', 'visual cortex', 'visual cortex', 'hippocampus',
             'visual cortex', 'visual cortex', 'hippocampus', 'hippocampus',
             'visual cortex', 'visual cortex', 'hippocampus', 'hippocampus',
             'visual cortex', 'visual cortex', 'hippocampus', 'visual cortex',
             'visual cortex', 'visual cortex', 'hippocampus', 'hippocampus',
             'hippocampus', 'visual cortex', 'hippocampus', 'visual cortex',
             'visual cortex', 'visual cortex', 'hippocampus', 'visual cortex',
             'hippocampus', 'hippocampus', 'hippocampus', 'hippocampus',
             'hippocampus', 'hippocampus', 'hippocampus', 'visual cortex',
             'visual cortex', 'hippocampus', 'visual cortex', 'hippocampus',
             'hippocampus', 'visual cortex', 'hippocampus', 'hippocampus',
             'hippocampus', 'thalamus', 'hippocampus', 'visual cortex',
             'visual cortex', 'hippocampus', 'hippocampus', 'visual cortex',
             'hippocampus', 'hippocampus', 'hippocampus', 'visual cortex',
             'hippocampus', 'hippocampus', 'visual cortex', 'visual cortex',
             'hippocampus', 'visual cortex', 'thalamus', 'visual cortex',
             'hippocampus', 'hippocampus', 'hippocampus', 'hippocampus',
             'hippocampus', 'hippocampus', 'visual cortex', 'thalamus',
             'hippocampus', 'hippocampus', 'hippocampus', 'hippocampus',
             'hippocampus', 'hippocampus', 'hippocampus', 'thalamus',
      ...
             'thalamus', 'thalamus', 'hippocampus', 'thalamus', 'thalamus',
             'thalamus', 'hippocampus', 'thalamus', 'visual cortex',
             'hippocampus', 'thalamus', 'thalamus', 'thalamus', 'thalamus',
             'thalamus', 'thalamus', 'visual cortex', 'visual cortex',
             'thalamus', 'visual cortex', 'thalamus', 'visual cortex',
             'hippocampus', 'thalamus', 'visual cortex', 'visual cortex',
             'thalamus', 'thalamus', 'thalamus', 'visual cortex', 'thalamus',
             'thalamus', 'visual cortex', 'thalamus', 'hippocampus', 'thalamus',
             'thalamus', 'thalamus', 'hippocampus', 'thalamus', 'hippocampus',
             'hippocampus', 'visual cortex', 'thalamus', 'thalamus',
             'visual cortex', 'hippocampus', 'visual cortex', 'thalamus',
             'hippocampus', 'thalamus', 'hippocampus', 'thalamus', 'thalamus',
             'visual cortex', 'thalamus', 'thalamus', 'visual cortex',
             'hippocampus', 'thalamus', 'thalamus', 'thalamus', 'hippocampus',
             'visual cortex', 'hippocampus', 'hippocampus', 'thalamus',
             'thalamus', 'thalamus', 'hippocampus', 'thalamus', 'visual cortex',
             'hippocampus', 'visual cortex', 'visual cortex', 'hippocampus',
             'hippocampus', 'thalamus', 'hippocampus', 'thalamus', 'thalamus',
             'thalamus', 'visual cortex', 'visual cortex', 'hippocampus',
             'thalamus'], dtype='<U17')
    • waveform_w
      (cell, sample, waveform_component)
      float32
      0.0 0.0 0.0 ... -0.0124 0.03969
      array([[[ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              ...,
              [-0.4481609 , -0.13800871,  0.0395868 ],
              [-0.42316234, -0.12405451,  0.02057694],
              [-0.37062392, -0.10515313,  0.01265119]],
             [[ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              ...,
              [-0.02701856,  0.06971366,  0.00617525],
              [-0.00638989,  0.06602961,  0.01049682],
              [ 0.01408696,  0.05259689,  0.01120061]],
             [[ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              ...,
      ...
              ...,
              [-0.06039745,  0.04920603, -0.03191666],
              [-0.03636225,  0.03228572, -0.0282197 ],
              [-0.01095693,  0.02940689, -0.01048632]],
             [[ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              ...,
              [-0.31517556,  0.1144239 , -0.04443172],
              [-0.2860381 ,  0.11826571, -0.04293353],
              [-0.2682851 ,  0.12098445, -0.02821838]],
             [[ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        ],
              ...,
              [-0.00454372, -0.00972404,  0.03496319],
              [ 0.01556368, -0.00708604,  0.03618595],
              [ 0.04895331, -0.01240014,  0.03969195]]], dtype=float32)
    • waveform_u
      (cell, waveform_component, probe)
      float32
      0.0 0.0 0.0 ... -0.01824 -0.01266
      array([[[ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ]],
             [[ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ]],
             [[ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ],
              [ 0.        ,  0.        ,  0.        , ...,  0.        ,
                0.        ,  0.        ]],
      ...
             [[ 0.05271564,  0.04852932,  0.04062656, ...,  0.04546255,
                0.04898005,  0.05257358],
              [-0.09452463, -0.08259631, -0.07637203, ..., -0.09408229,
               -0.08096855, -0.08106099],
              [ 0.01066507,  0.0676906 ,  0.01226856, ...,  0.09427451,
                0.06466331,  0.08417223]],
             [[ 0.        ,  0.0172444 ,  0.        , ...,  0.01804066,
                0.        ,  0.02229728],
              [ 0.        ,  0.00105885,  0.        , ..., -0.0059192 ,
                0.        , -0.00219953],
              [ 0.        ,  0.00052403,  0.        , ..., -0.01789685,
                0.        , -0.02679556]],
             [[ 0.00581419,  0.0047881 ,  0.00665496, ...,  0.        ,
                0.0043255 ,  0.00438046],
              [-0.00903494,  0.00174251, -0.00360132, ...,  0.        ,
               -0.01243377,  0.00495622],
              [-0.01273568, -0.01582302, -0.02444749, ...,  0.        ,
               -0.01824343, -0.0126649 ]]], dtype=float32)
    • lfp
      (brain_area_lfp, trial, time)
      float64
      -57.29 -45.63 ... -18.44 -15.9
      array([[[-5.72920408e+01, -4.56320408e+01, -4.30820408e+01, ...,
                1.76779592e+01, -1.84920408e+01,  1.37779592e+01],
              [-4.42469388e+00, -3.89446939e+01, -4.50246939e+01, ...,
                3.33953061e+01,  8.30253061e+01,  1.57530612e+00],
              [-5.88420408e+01, -5.01204082e+00, -5.55204082e+00, ...,
                5.89795918e+00,  1.20479592e+01, -6.28204082e+00],
              ...,
              [-2.02538776e+01,  3.95361224e+01,  1.13761224e+01, ...,
                1.33561224e+01,  8.27612245e+00,  4.86612245e+00],
              [ 1.83336735e+01, -4.53963265e+01, -1.18663265e+01, ...,
                5.72836735e+01,  6.66836735e+01, -2.53863265e+01],
              [ 7.20938776e+00, -1.27406122e+01,  4.65693878e+01, ...,
               -2.62806122e+01, -1.95806122e+01, -4.79306122e+01]],
             [[-3.14265306e+01, -4.05665306e+01, -3.83065306e+01, ...,
               -3.14653061e+00, -4.58865306e+01, -2.84065306e+01],
              [-1.27657143e+01,  1.42857143e-02, -2.93457143e+01, ...,
                3.69942857e+01,  4.23142857e+01,  9.15428571e+00],
              [ 7.59387755e+00,  1.04738776e+01, -6.86122449e-01, ...,
                4.09387755e+00,  6.37387755e+00,  6.83387755e+00],
      ...
              [-4.75484694e+00,  3.29515306e+00,  6.38265306e+00, ...,
                2.73265306e+00,  3.00765306e+00,  9.33265306e+00],
              [ 2.12500000e+00,  5.01250000e+00, -2.50000000e-01, ...,
               -1.75000000e-01, -6.35000000e+00, -8.71250000e+00],
              [ 4.14974490e+00,  2.79974490e+00, -1.76275510e+00, ...,
               -1.61377551e+01, -8.92525510e+00,  7.24744898e-01]],
             [[-4.82970522e+00, -4.51859410e+00, -6.26303855e+00, ...,
               -5.85192744e+00, -1.07630385e+01, -9.56303855e+00],
              [ 6.22902494e-01, -8.54875283e-01,  2.41179138e+00, ...,
               -1.33265306e+00, -2.34376417e+00,  5.56235828e-01],
              [ 7.31360544e+00,  9.13832200e-02, -2.50861678e+00, ...,
                3.40249433e+00, -1.57528345e+00, -2.75283447e-01],
              ...,
              [-2.47619048e+00,  2.94603175e+00,  9.46031746e-01, ...,
               -2.22063492e+00,  3.07936508e+00,  1.83492063e+00],
              [ 1.24081633e+00,  3.67414966e+00,  2.29705215e-01, ...,
                2.37414966e+00,  3.40748299e+00,  7.29705215e-01],
              [-4.02018141e+00,  1.13151927e-01, -6.40907029e+00, ...,
               -1.38535147e+01, -1.84424036e+01, -1.58979592e+01]]])
    • spike_time
      (spike_id)
      float32
      0.01967 0.09227 ... 2.355 2.475
      array([0.01966781, 0.09226781, 0.19510114, ..., 2.313836  , 2.3547363 ,
             2.4751368 ], dtype=float32)
    • spike_cell
      (spike_id)
      uint32
      1 1 1 1 1 1 ... 698 698 698 698 698
      array([  1,   1,   1, ..., 698, 698, 698], dtype=uint32)
    • spike_trial
      (spike_id)
      uint32
      1 1 1 1 1 1 ... 450 450 450 450 450
      array([  1,   1,   1, ..., 450, 450, 450], dtype=uint32)
    • trial
      PandasIndex
      PandasIndex(Index([  1,   2,   3,   4,   5,   6,   7,   8,   9,  10,
             ...
             331, 332, 333, 334, 335, 336, 337, 338, 339, 340],
            dtype='int32', name='trial', length=340))
    • time
      PandasIndex
      PandasIndex(Index([0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09,  0.1,
             ...
             2.41, 2.42, 2.43, 2.44, 2.45, 2.46, 2.47, 2.48, 2.49,  2.5],
            dtype='float64', name='time', length=250))
    • cell
      PandasIndex
      PandasIndex(Index([  1,   2,   3,   4,   5,   6,   7,   8,   9,  10,
             ...
             689, 690, 691, 692, 693, 694, 695, 696, 697, 698],
            dtype='int32', name='cell', length=698))
    • waveform_component
      PandasIndex
      PandasIndex(Index([1, 2, 3], dtype='int32', name='waveform_component'))
    • probe
      PandasIndex
      PandasIndex(Index([  1,   2,   3,   4,   5,   6,   7,   8,   9,  10,
             ...
             375, 376, 377, 378, 379, 380, 381, 382, 383, 384],
            dtype='int32', name='probe', length=384))
    • brain_area_lfp
      PandasIndex
      PandasIndex(Index(['DG', 'LGd', 'SUB', 'VISp', 'ACA', 'MOs', 'PL', 'CA1', 'DG', 'LH', 'MD',
             'VISam'],
            dtype='object', name='brain_area_lfp'))
    • spike_id
      PandasIndex
      PandasIndex(Index([      1,       2,       3,       4,       5,       6,       7,       8,
                   9,      10,
             ...
             3185879, 3185880, 3185881, 3185882, 3185883, 3185884, 3185885, 3185886,
             3185887, 3185888],
            dtype='int32', name='spike_id', length=3185888))

Example: Get the reaction time for each trial in the session.

dset['reaction_time']
<xarray.DataArray 'reaction_time' (trial: 340)> Size: 3kB
array([ 740.,  160.,  730.,  210.,  160.,  220.,  170.,  130.,  100.,
        140.,  180.,  140.,  220.,  260.,  130.,   inf,  150.,   90.,
         50.,  220.,  120., 1430.,  340.,  220.,  140.,   80.,  210.,
        190.,  130.,   inf,  130.,  480.,   inf,  210.,  210.,  220.,
        180.,  110.,  200.,  180.,  210.,   60.,  130.,  140.,  140.,
        120.,  160.,  150.,  200.,  110.,  140.,  190.,  110.,  190.,
        190.,  180.,  150.,  170.,  130.,   10., 1940.,   80.,  190.,
        230., 1040.,   90.,  190.,  130.,   inf,  130.,  180.,   70.,
         inf,  100.,   inf,  190.,  150.,  240.,  120.,    0.,  240.,
        180., 1220.,   inf,  220.,  210.,  280.,  480.,  240.,  190.,
        220.,  120., 1390.,  320.,  100.,  420.,  460.,  140.,  160.,
         inf,  300.,  170.,  160.,  160.,  250.,  510.,  750.,  150.,
          0.,  160.,   10.,   20.,  240.,  470.,  750.,  780., 1390.,
         inf,  170.,  160.,  240., 1400.,  310.,  180.,  690.,  460.,
        270.,   20.,  580.,  390.,  150.,  190.,  290.,   40.,  460.,
        150.,  680.,  130.,  180.,  460.,   inf,  240.,  220.,  230.,
        160.,  210., 1190.,  740.,   90.,  110.,  270.,  190.,  210.,
         inf,   inf,  170., 1540.,   90.,  140.,   60.,  200.,  180.,
        170.,  200.,  200.,  150.,  180.,   40.,  220.,  200.,   10.,
        270.,  190.,   10.,  150.,   inf,  210., 1750.,  320.,  330.,
        630.,  650.,  860.,  290., 1800., 1220.,   inf,  140.,  170.,
        140.,  140.,  130.,   10.,  110.,  620.,  310.,  220.,  130.,
        100.,   80.,  370.,  970.,  140., 1960.,  500.,  180.,  290.,
       1030.,   inf,  230.,  180.,  210.,  210.,   inf,  230.,  250.,
        220.,  260.,   inf,   70.,  130.,  450.,  190.,  500.,  330.,
        420.,  810.,  170.,  180.,  160.,  200.,  200.,  190.,  330.,
        140.,  230.,   20.,  260.,  250.,  200.,  380.,  830.,   inf,
        270.,  200.,  230.,  200.,  310.,  170.,   60.,  140.,   80.,
         70.,  220.,  300.,  200.,  230.,  190.,   30.,  120.,  190.,
        110.,   60.,  200.,  300.,  140.,  110.,   inf,  210.,   60.,
        210.,  160.,   60.,  280.,   80.,  220.,  230.,  570.,  140.,
        280.,  200.,  170.,  240.,  190.,  220.,   80.,  180.,  190.,
         80.,   40.,  240.,   30.,  250.,  260.,  210.,  380.,   80.,
        590.,  160.,  880.,  830., 1930.,  250.,  190.,  190.,  340.,
         inf,  110.,  180.,  240.,  180.,   inf,  150.,  210.,  190.,
        220.,  240.,  240.,  270.,  190.,  330.,   50.,  250.,  250.,
        800.,  320.,  230.,   inf,   inf,   inf,   inf,   inf,   inf,
         inf,   inf,   inf,   inf,   inf,   inf,   inf])
Coordinates:
  * trial    (trial) int32 1kB 1 2 3 4 5 6 7 8 ... 334 335 336 337 338 339 340
xarray.DataArray
'reaction_time'
  • trial: 340
  • 740.0 160.0 730.0 210.0 160.0 220.0 170.0 ... inf inf inf inf inf inf
    array([ 740.,  160.,  730.,  210.,  160.,  220.,  170.,  130.,  100.,
            140.,  180.,  140.,  220.,  260.,  130.,   inf,  150.,   90.,
             50.,  220.,  120., 1430.,  340.,  220.,  140.,   80.,  210.,
            190.,  130.,   inf,  130.,  480.,   inf,  210.,  210.,  220.,
            180.,  110.,  200.,  180.,  210.,   60.,  130.,  140.,  140.,
            120.,  160.,  150.,  200.,  110.,  140.,  190.,  110.,  190.,
            190.,  180.,  150.,  170.,  130.,   10., 1940.,   80.,  190.,
            230., 1040.,   90.,  190.,  130.,   inf,  130.,  180.,   70.,
             inf,  100.,   inf,  190.,  150.,  240.,  120.,    0.,  240.,
            180., 1220.,   inf,  220.,  210.,  280.,  480.,  240.,  190.,
            220.,  120., 1390.,  320.,  100.,  420.,  460.,  140.,  160.,
             inf,  300.,  170.,  160.,  160.,  250.,  510.,  750.,  150.,
              0.,  160.,   10.,   20.,  240.,  470.,  750.,  780., 1390.,
             inf,  170.,  160.,  240., 1400.,  310.,  180.,  690.,  460.,
            270.,   20.,  580.,  390.,  150.,  190.,  290.,   40.,  460.,
            150.,  680.,  130.,  180.,  460.,   inf,  240.,  220.,  230.,
            160.,  210., 1190.,  740.,   90.,  110.,  270.,  190.,  210.,
             inf,   inf,  170., 1540.,   90.,  140.,   60.,  200.,  180.,
            170.,  200.,  200.,  150.,  180.,   40.,  220.,  200.,   10.,
            270.,  190.,   10.,  150.,   inf,  210., 1750.,  320.,  330.,
            630.,  650.,  860.,  290., 1800., 1220.,   inf,  140.,  170.,
            140.,  140.,  130.,   10.,  110.,  620.,  310.,  220.,  130.,
            100.,   80.,  370.,  970.,  140., 1960.,  500.,  180.,  290.,
           1030.,   inf,  230.,  180.,  210.,  210.,   inf,  230.,  250.,
            220.,  260.,   inf,   70.,  130.,  450.,  190.,  500.,  330.,
            420.,  810.,  170.,  180.,  160.,  200.,  200.,  190.,  330.,
            140.,  230.,   20.,  260.,  250.,  200.,  380.,  830.,   inf,
            270.,  200.,  230.,  200.,  310.,  170.,   60.,  140.,   80.,
             70.,  220.,  300.,  200.,  230.,  190.,   30.,  120.,  190.,
            110.,   60.,  200.,  300.,  140.,  110.,   inf,  210.,   60.,
            210.,  160.,   60.,  280.,   80.,  220.,  230.,  570.,  140.,
            280.,  200.,  170.,  240.,  190.,  220.,   80.,  180.,  190.,
             80.,   40.,  240.,   30.,  250.,  260.,  210.,  380.,   80.,
            590.,  160.,  880.,  830., 1930.,  250.,  190.,  190.,  340.,
             inf,  110.,  180.,  240.,  180.,   inf,  150.,  210.,  190.,
            220.,  240.,  240.,  270.,  190.,  330.,   50.,  250.,  250.,
            800.,  320.,  230.,   inf,   inf,   inf,   inf,   inf,   inf,
             inf,   inf,   inf,   inf,   inf,   inf,   inf])
    • trial
      (trial)
      int32
      1 2 3 4 5 6 ... 336 337 338 339 340
      array([  1,   2,   3, ..., 338, 339, 340], dtype=int32)
    • trial
      PandasIndex
      PandasIndex(Index([  1,   2,   3,   4,   5,   6,   7,   8,   9,  10,
             ...
             331, 332, 333, 334, 335, 336, 337, 338, 339, 340],
            dtype='int32', name='trial', length=340))

Exercise: Get the response type for each trial:

Solution
dset['response_type']
<xarray.DataArray 'response_type' (trial: 340)> Size: 3kB
array([ 0.,  1.,  0.,  1., -1., -1., -1., -1.,  1., -1., -1., -1.,  1.,
        0., -1.,  0.,  1.,  1.,  1.,  1.,  1., -1.,  1., -1., -1.,  0.,
        1.,  1., -1.,  0.,  1., -1.,  0.,  0., -1., -1., -1.,  1.,  1.,
        1., -1.,  0.,  1., -1., -1.,  1.,  1., -1.,  1., -1., -1.,  1.,
       -1., -1., -1.,  1.,  1., -1., -1., -1.,  0.,  0., -1.,  1.,  0.,
       -1., -1.,  1.,  0.,  1.,  1.,  1.,  0.,  1.,  0.,  1., -1.,  1.,
       -1.,  1.,  1.,  1., -1.,  0.,  1., -1., -1.,  0.,  1.,  1., -1.,
        1., -1.,  1., -1., -1.,  0., -1.,  1.,  0., -1., -1., -1.,  1.,
        1., -1.,  0.,  1.,  1.,  1.,  1., -1.,  0.,  1., -1.,  1.,  0.,
        0., -1., -1., -1., -1.,  0.,  1.,  0.,  0.,  1., -1., -1.,  0.,
       -1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  0.,  1., -1.,
       -1.,  1.,  1., -1.,  0., -1., -1.,  0.,  1.,  1.,  0.,  0.,  1.,
        0.,  1.,  1., -1.,  1., -1.,  1.,  1., -1.,  1.,  1.,  1.,  1.,
       -1.,  1.,  1., -1., -1., -1.,  0., -1.,  1.,  0., -1., -1., -1.,
       -1., -1., -1., -1.,  0.,  1., -1.,  0.,  1., -1., -1.,  1.,  1.,
        0., -1., -1., -1., -1., -1., -1., -1., -1.,  0., -1., -1., -1.,
        0.,  1., -1., -1., -1.,  0.,  1., -1.,  1., -1.,  0., -1., -1.,
        0., -1., -1., -1., -1.,  0.,  1.,  1.,  1.,  1.,  1., -1., -1.,
       -1.,  1., -1.,  1., -1.,  1.,  1., -1.,  0.,  1., -1.,  1., -1.,
        1., -1.,  1.,  1.,  1., -1.,  1., -1.,  1., -1.,  1.,  1.,  1.,
        1., -1., -1.,  1.,  1., -1.,  1.,  0.,  1., -1.,  1.,  1.,  1.,
       -1.,  1.,  1., -1., -1., -1.,  1.,  1.,  1.,  1., -1.,  1.,  1.,
       -1., -1.,  1.,  1.,  1.,  1., -1., -1.,  1.,  1.,  0.,  1.,  1.,
        1., -1.,  0., -1.,  1., -1., -1.,  0., -1.,  1.,  1.,  1.,  0.,
       -1., -1., -1.,  0.,  1., -1., -1.,  1.,  1.,  1., -1.,  1.,  1.,
        1., -1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
        0.,  0.])
Coordinates:
  * trial    (trial) int32 1kB 1 2 3 4 5 6 7 8 ... 334 335 336 337 338 339 340
xarray.DataArray
'response_type'
  • trial: 340
  • 0.0 1.0 0.0 1.0 -1.0 -1.0 -1.0 -1.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
    array([ 0.,  1.,  0.,  1., -1., -1., -1., -1.,  1., -1., -1., -1.,  1.,
            0., -1.,  0.,  1.,  1.,  1.,  1.,  1., -1.,  1., -1., -1.,  0.,
            1.,  1., -1.,  0.,  1., -1.,  0.,  0., -1., -1., -1.,  1.,  1.,
            1., -1.,  0.,  1., -1., -1.,  1.,  1., -1.,  1., -1., -1.,  1.,
           -1., -1., -1.,  1.,  1., -1., -1., -1.,  0.,  0., -1.,  1.,  0.,
           -1., -1.,  1.,  0.,  1.,  1.,  1.,  0.,  1.,  0.,  1., -1.,  1.,
           -1.,  1.,  1.,  1., -1.,  0.,  1., -1., -1.,  0.,  1.,  1., -1.,
            1., -1.,  1., -1., -1.,  0., -1.,  1.,  0., -1., -1., -1.,  1.,
            1., -1.,  0.,  1.,  1.,  1.,  1., -1.,  0.,  1., -1.,  1.,  0.,
            0., -1., -1., -1., -1.,  0.,  1.,  0.,  0.,  1., -1., -1.,  0.,
           -1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  0.,  1., -1.,
           -1.,  1.,  1., -1.,  0., -1., -1.,  0.,  1.,  1.,  0.,  0.,  1.,
            0.,  1.,  1., -1.,  1., -1.,  1.,  1., -1.,  1.,  1.,  1.,  1.,
           -1.,  1.,  1., -1., -1., -1.,  0., -1.,  1.,  0., -1., -1., -1.,
           -1., -1., -1., -1.,  0.,  1., -1.,  0.,  1., -1., -1.,  1.,  1.,
            0., -1., -1., -1., -1., -1., -1., -1., -1.,  0., -1., -1., -1.,
            0.,  1., -1., -1., -1.,  0.,  1., -1.,  1., -1.,  0., -1., -1.,
            0., -1., -1., -1., -1.,  0.,  1.,  1.,  1.,  1.,  1., -1., -1.,
           -1.,  1., -1.,  1., -1.,  1.,  1., -1.,  0.,  1., -1.,  1., -1.,
            1., -1.,  1.,  1.,  1., -1.,  1., -1.,  1., -1.,  1.,  1.,  1.,
            1., -1., -1.,  1.,  1., -1.,  1.,  0.,  1., -1.,  1.,  1.,  1.,
           -1.,  1.,  1., -1., -1., -1.,  1.,  1.,  1.,  1., -1.,  1.,  1.,
           -1., -1.,  1.,  1.,  1.,  1., -1., -1.,  1.,  1.,  0.,  1.,  1.,
            1., -1.,  0., -1.,  1., -1., -1.,  0., -1.,  1.,  1.,  1.,  0.,
           -1., -1., -1.,  0.,  1., -1., -1.,  1.,  1.,  1., -1.,  1.,  1.,
            1., -1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
            0.,  0.])
    • trial
      (trial)
      int32
      1 2 3 4 5 6 ... 336 337 338 339 340
      array([  1,   2,   3, ..., 338, 339, 340], dtype=int32)
    • trial
      PandasIndex
      PandasIndex(Index([  1,   2,   3,   4,   5,   6,   7,   8,   9,  10,
             ...
             331, 332, 333, 334, 335, 336, 337, 338, 339, 340],
            dtype='int32', name='trial', length=340))

Exercise: Get the contrast levels of both the left and right stimulus for each trial (note: you’ll need double-square brackets for this (e.g. dset[['a', 'b']])).

Solution
dset[['contrast_left', 'contrast_right']]
<xarray.Dataset> Size: 2kB
Dimensions:         (trial: 340)
Coordinates:
  * trial           (trial) int32 1kB 1 2 3 4 5 6 7 ... 335 336 337 338 339 340
Data variables:
    contrast_left   (trial) int8 340B 0 0 0 100 25 50 0 0 ... 0 0 0 0 0 0 0 0
    contrast_right  (trial) int8 340B 0 0 0 50 50 50 ... 100 100 100 100 100 100
xarray.Dataset
    • trial: 340
    • trial
      (trial)
      int32
      1 2 3 4 5 6 ... 336 337 338 339 340
      array([  1,   2,   3, ..., 338, 339, 340], dtype=int32)
    • contrast_left
      (trial)
      int8
      0 0 0 100 25 50 0 ... 0 0 0 0 0 0 0
      array([  0,   0,   0, 100,  25,  50,   0,   0, 100,  25,   0,  25,  50,
               0,   0,   0,  25, 100, 100, 100,  50,  25,  25,  25,   0,   0,
              50, 100,   0,   0, 100,   0,   0,   0,  50,  50,   0,  50,  50,
             100,   0,   0,  25,  25,   0, 100,  50,  25,  50,   0,   0,  25,
             100,   0,   0, 100,  50,   0,  25,  50,   0,   0,  25, 100,   0,
               0,   0,   0,   0, 100, 100,  50,   0,  25,   0,  50,  25,  50,
              25,  25,  25, 100,   0,   0,  25,   0,   0,   0,  50, 100,  25,
               0,   0,   0,   0,   0,   0,  25, 100,   0,   0,   0,   0,  50,
              50,   0,   0,  50, 100,  50,  50,  25,   0,   0,   0,   0,   0,
               0,  25,   0,   0,   0,   0, 100,   0,   0,   0,   0,   0,   0,
               0,   0,  50,   0,   0,   0,   0,   0,   0,   0,   0,  50,  25,
              25,  50, 100,   0,   0,  25,   0,   0, 100, 100,   0,   0, 100,
               0, 100,  50,  25,  50,   0, 100,  50,  25, 100, 100, 100,  50,
               0,  50,  25,  25,  25,  50,   0,   0,   0,   0,   0,   0,   0,
               0,   0,   0,   0,   0, 100,   0,   0,  50,   0,   0,   0,   0,
               0,  50,  25,   0,  25,  25,   0,   0,   0,   0,  50,  25,   0,
               0, 100,  25,   0,   0,   0,  50,  25, 100,   0,   0,   0,   0,
               0,   0,   0,   0,   0,   0, 100, 100,  50,  50, 100,  50,   0,
              25,  25,  25, 100,   0, 100,   0,   0,   0,  25,  50,  25,  25,
              50,   0,  50, 100,  25,   0, 100,   0,  50,  25, 100,  50,  50,
              50,   0,   0, 100, 100,  50,  50,   0,  25,   0, 100, 100,  25,
               0, 100,  50,   0,   0,   0, 100, 100,  50,  50,   0,  50, 100,
              25,  25,  50, 100,  50, 100,  25,   0,  50,   0,   0,   0,   0,
               0,   0,   0,   0, 100,   0,   0,   0,  25, 100, 100, 100,   0,
               0,   0,   0,  25, 100,   0,   0, 100,  25, 100,  25,  25,  50,
             100,  50,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
               0,   0], dtype=int8)
    • contrast_right
      (trial)
      int8
      0 0 0 50 50 ... 100 100 100 100 100
      array([  0,   0,   0,  50,  50,  50,  50, 100,  25, 100,  50, 100,   0,
               0,   0,   0,   0,  50,   0,   0, 100,   0,  25, 100,  25,   0,
              25,  25,   0,   0,  50,   0,   0,   0,   0,  25, 100,   0,  50,
              50,  50,   0,   0,  50,  25,  50,   0, 100,   0, 100, 100,   0,
             100, 100, 100,   0,   0, 100, 100,  25,   0,   0,  50,  25,   0,
             100, 100,   0,   0,   0,  25,   0,   0,  50,   0,  25,  25,  25,
             100,   0,  25,   0,   0,   0,   0,  50,   0,   0,  25,  25, 100,
               0,   0,   0,   0,   0,   0, 100,   0,   0,  50, 100, 100,   0,
              25,   0,   0,   0,   0,   0,  25, 100,   0,   0,   0,   0,   0,
               0, 100,   0,   0,   0,   0,  50,   0,   0,   0,   0,   0,   0,
             100, 100,   0, 100,   0,   0,   0,   0,   0,   0,   0,   0,  50,
             100,   0,   0,   0,   0,  50, 100,   0,  25,  25,   0,   0,  25,
               0, 100,  25, 100,   0,  50,   0, 100, 100,  25,   0,  50, 100,
              25,   0,  50, 100,  50, 100,   0,   0,   0,   0,   0,   0,   0,
               0,   0,   0,   0,   0,  25, 100,   0,   0,  50,  25,   0,   0,
               0, 100,  25,  50,  25, 100,   0,   0,   0,   0, 100,  50,   0,
               0,  25,  50,  50,   0,   0,   0, 100,  25,   0,   0,  25,   0,
               0,   0,   0,   0,   0,   0,   0, 100, 100,  50,  50,  25,  25,
              50, 100, 100,   0,  25,   0,   0,   0,   0,   0, 100, 100, 100,
               0, 100,  50,  50,   0, 100,  25,  50,   0, 100,   0,   0,   0,
              25,  50,  50,  50,  25,  50, 100,   0,   0, 100,   0,  50,   0,
             100,  25,   0,  25,  50,  25, 100,  25,   0,  50,  25,  25,   0,
              50, 100,   0,   0,  25,  25,  50,  50,   0,   0,   0,   0,   0,
               0,   0,   0,  50,   0, 100,  50,   0, 100, 100,   0,  25,   0,
             100,  50,  50,   0,   0,  50,  25,   0,   0,  25, 100,  25,   0,
              25,  50, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
             100, 100], dtype=int8)
    • trial
      PandasIndex
      PandasIndex(Index([  1,   2,   3,   4,   5,   6,   7,   8,   9,  10,
             ...
             331, 332, 333, 334, 335, 336, 337, 338, 339, 340],
            dtype='int32', name='trial', length=340))

Exercise: Get the response times for trials 10 through 16 (tip: .loc).

Solution
dset['response_time'].loc[10:16]
<xarray.DataArray 'response_time' (trial: 7)> Size: 56B
array([0.55870603, 0.97381392, 0.65443056, 0.76496615, 1.99861344,
       0.69717263, 1.90782541])
Coordinates:
  * trial    (trial) int32 28B 10 11 12 13 14 15 16
xarray.DataArray
'response_time'
  • trial: 7
  • 0.5587 0.9738 0.6544 0.765 1.999 0.6972 1.908
    array([0.55870603, 0.97381392, 0.65443056, 0.76496615, 1.99861344,
           0.69717263, 1.90782541])
    • trial
      (trial)
      int32
      10 11 12 13 14 15 16
      array([10, 11, 12, 13, 14, 15, 16], dtype=int32)
    • trial
      PandasIndex
      PandasIndex(Index([10, 11, 12, 13, 14, 15, 16], dtype='int32', name='trial'))

Section 2: Spike Count Analysis For Specific Brain Regions: Practicing Logical Indexing on Multidimensional Numpy Arrays

Different areas in the brain are commonly believed to specialize in specific aspects of behavior or task. This makes analyzing spiking activity across brain regions an essential step in many neuroscience data analysis pipelines. Over the next couple of exercises let’s focus on how the spike counts of neurons differ across different brain regions.

Code Description
np.unique(data) Finds the unique elements of an array.
bool_array = var_name == specific_value Creates a boolean array where each element is True if the corresponding element in var_name equals specific_value; otherwise False.
var_name[bool_array] Uses a boolean array to filter elements of var_name, selecting only those that correspond to True in the boolean array.
var_name.mean(axis=0) or np.mean(var_name, axis=0) Compute the mean across the first dimension, i.e. across rows.
var_name.mean(axis=(0, 1)) or np.mean(var_name, axis=(0, 1)) Compute the mean across the first and second dimensions
var_name.sum(axis=N) Sum along axis N (0=rows, 1=columns, etc.).
array.values Get the underlying numpy array from an XArray object.
array.item() Extract a scalar value from a single-element array.
plt.imshow(data) For a 2D array, make a heat map.
plt.plot(x, y) Make a line plot.
plt.xticks(positions, labels) Customize x-axis tick positions and labels.
data.sum(dim='name') Sum along named dimension in XArray.
data.plot.imshow(), data.plot.line() Built-in XArray plotting methods.

For the exercises below, we’ll use the spike_count and brain_groups variables and their associated coordinate data to explore some of the spiking data.

Exercises

Example: What is the total number of neurons recorded from the visual cortex?

sum(dset['brain_groups'] == 'visual cortex').item()
145
(dset['brain_groups']== 'visual cortex').sum().item()
145

Exercise: What is the total number of neurons recorded from thalamus?

Solution
(dset['brain_groups']== 'thalamus').sum().item()
155

Exercise: What is the proportion of neurons recorded from hippocampus?

Solution
(dset['brain_groups']== 'hippocampus').sum().item()/len(dset['brain_groups'])
0.3151862464183381

Exercise: How many non-zero spike count measurements were there?

Solution
np.sum(dset["spike_count"] > 0).item()
2301519

Exercise: What proportion of cells had more than 300 spikes measured across all trials and time?

Solution
np.mean(np.sum(dset["spike_count"], axis=(1, 2)) > 300).item()
0.7263610315186246

Exercise: (extra): What proportion of trials had more than 6000 spikes across all cells measured?

Solution
np.mean(np.sum(dset["spike_count"], axis=(0, 2)) > 6000).item()
0.9941176470588236

Exercise: Compute the population spike count (i.e. average spike count across all neurons) for neurons in thalamus, and visualize it using the plt.imshow() plotting function.

Solution
mask = dset['brain_groups'] == 'thalamus'
pop_firing_rate = dset['spike_count'][mask,:,:].mean(axis=0)
plt.imshow(pop_firing_rate, cmap = 'bwr')

Exercise: From the spike counts, extract out all the trials and time points, but only the cells from the thalamus brain area. Plot the total spike counts across trials as a heat map.

Solution
time = dset['spike_count'].time.values
mask = dset['brain_groups'] == 'thalamus'
data = dset['spike_count'][mask, :, :]
total_spikes = data.sum(axis=1)
plt.imshow(total_spikes);
plt.xticks(np.arange(len(time))[::30], time[::30]);

Exercise: From the spike counts, extract out all the trials and time points, but only the cells from the Visual cortex brain area. Plot the total spike counts across trials as a heat map.

Solution
mask = dset['brain_groups'] == 'visual cortex'
data = dset['spike_count'][mask, :, :]
total_spikes = data.sum(axis=1)
plt.imshow(total_spikes);
plt.xticks(np.arange(len(time))[::30], time[::30]);

Exercise: For each trial and time point, show the total activity across all cells in the visual cortex

Solution
mask = dset['brain_groups'] == 'visual cortex'
data = dset['spike_count'][mask, :, :]
total_spikes = data.sum(axis=0)
plt.imshow(total_spikes);
plt.xticks(np.arange(len(time))[::30], time[::30]);

Exercise: For each trial and time point, show the total activity across all cells in the hippocampus.

Solution
mask = dset['brain_groups'] == 'hippocampus'
data = dset['spike_count'][mask, :, :]
total_spikes = data.sum(axis=0)
plt.imshow(total_spikes);
plt.xticks(np.arange(len(time))[::30], time[::30]);

Example: Make a line plot showing the average number of total spikes for all cells in the thalamus.

mask = dset['brain_groups'] == 'thalamus'
data = dset['spike_count'][mask, :, :].sum(axis=0).mean(axis=0)
plt.plot(time, data);
plt.xlabel('time (secs)')
plt.ylabel('average num spikes');

Exercise: Make a line plot showing the average number of total spikes for all cells in the hippocampus.

Solution
mask = dset['brain_groups'] == 'hippocampus'
data = dset['spike_count'][mask, :, :].sum(axis=0).mean(axis=0)
plt.plot(time, data);
plt.xlabel('time (secs)')
plt.ylabel('total spikes');

Exercise: Make a line plot showing the average number of total spikes for all cells in the visual cortex.

Solution
mask = dset['brain_groups'] == 'visual cortex'
data = dset['spike_count'][mask, :, :].sum(axis=0).mean(axis=0)
plt.plot(time, data);
plt.xlabel('time (secs)')
plt.ylabel('average num spikes');

Exercise: Make a plot showing the average spike counts for all three brain areas (visual cortex, thalamus, and hippocampus)

Solution
mask = dset['brain_groups'] == 'visual cortex'
data = dset['spike_count'][mask, :, :].sum(axis=0).mean(axis=0)
plt.plot(time, data, label='Visual Cortex');

mask = dset['brain_groups'] == 'thalamus'
data = dset['spike_count'][mask, :, :].sum(axis=0).mean(axis=0)
plt.plot(time, data, label='Thalamus');

mask = dset['brain_groups'] == 'hippocampus'
data = dset['spike_count'][mask, :, :].sum(axis=0).mean(axis=0)
plt.plot(time, data, label='Hippocampus');

plt.xlabel('time (secs)')
plt.ylabel('average num spikes');
plt.legend();

Section 3: Demo: Simplifying this process using XArray

Exercises

Example: This can also be done without creating a bunch of variables. Here are two examples:

dset['spike_count'][dset['brain_groups'] == 'visual cortex'].sum(dim='cell').plot.imshow();

dset['spike_count'][dset['brain_groups'] == 'visual cortex'].sum(dim=('cell', 'trial')).plot.line();