PyStarters 2021: hands-on practice with git/Github, Python functions and neural data analysis (May 13)
This session will only use a text editor to write code and a terminal to run it (no PyCharm needed). We will cover:
-
Basic use of git and Github (clone, commit, status, checkout, push, pull).
-
Python functions, positional and keyword arguments.
-
Use of functions to visualize electrophysiological recordings and linear regression to learn about them.
We will experiment with the following packages:
pandas
for data manipulationmatplotlib
for visualizationsstatsmodels
for linear regression
and with code organization in modules.
We will characterize electrophysiological recordings from mice in the experiment depicted in the figure below probing the integration of visual and vestibular information across the brain (Keshavarzi, Tyson, Lenzi et al., 2021).
Please before the session do the following.
-
create a Github account (if you don't have one) here
-
install git
-
Windows
Follow the instructions here and Launch Git Bash Shell as mentioned in section How to Launch Git in Windows of the instructions.
Use the git bash shell as the terminal in the following instructions.
Follow the instructions here to integrate conda with git.
-
Linux and Mac
Follow the instructions here
-
-
in a terminal (or Git Bash Shell if you use Windows) type
conda activate pystarters
(changepystarters
to the name that you used for the conda environment you created for the course). -
in the terminal type:
pip install matplotlib
pip install statsmodels
pip install pandas
-
in the terminal type
cd <pystarters directory>
where<pystarters directory>
is the directory you created for the course. -
in the terminal type
git clone https://github.com/joacorapela/pystarters2021.git
-
in the terminal type
cd pystarters2021/code/scripts
-
in the terminal type
python doFirstPlot.py Visual
.
If your setup is correct, the last command command should create the plot <pystarters directory>/figures/spikeRateVsabsSpeedV1Visual.png
. If this plot is not created please email Joaquin Rapela to troubleshoot the problem.