The for statement followed by the if conditional is equivalent to nesting the if statement inside the for loop in the previous example. This allows us to retrieve the index (timing) of only values when that represent spikes (recall we defined spike_value as 1). To the end of this is added a conditional, if x = spike_value. In this case, they are x, which is one value in spike_train, and i, the enumeration variable that stores the current position in the list (iteration through the loop). The enumerate() function enumerates (counts) the items as it goes through a loop, so each time through the loop we have two variables being tracked. It’s a useful and compact way to iterate over some set of items to get them into a list. Take some time to break this down and understand it - there’s a lot going on! Recall that list comprehension is used to create a for loop in a single line, and return a list. This is a slightly more complicated list comprehension than we’ve seen in the past. Each value represents an evenly-spaced point in time (e.g., every 1 ms), where 0 encodes time points at which no action potential was detected, and 1 represents times when action potentials occurred: We can store the data from each trial in a list, spike_train. Data was sampled from the electrode every millisecond. On each trial, recording was started and then the 550 nm light was turned on 4 ms later, for a duration of 10 ms. When light of that wavelength is directed at the neuron, it tends to fire.įor this hypothetical experiment, we used an electrode to record action potentials from this optogenetically-engineered neuron to confirm that it tends to fire in response to 550 nm light. Imagine an experiment involving a neuron that was genetically engineered for optogenetics, meaning that it expresses genes sensitive to a specific wavelength of light (550 nm, which is green to learn more about optogenetics, check out this video by Prof. # Import libraries we'll need import matplotlib.pyplot as plt import numpy as np Our first spike train # Reading and Visualizing Structural MRI Data.Averaging ERPs: Creating MNE Evoked objects.Working with Multielectrode Data in pandas.Effects of Light Intensity on Spike Rate.Basic Statistics in Python: t tests with SciPy.Accessibility and Human Factors in Plotting.Procedural versus Object-Oriented Plotting in Matplotlib.Introduction to Plotting with Matplotlib.Working With Multiple Data Files Using Copilot.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |