37 KiB
37 KiB
Exercise: Compute summary statistics for the neural data¶
In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
# Set some Pandas options: maximum number of rows/columns it's going to display
pd.set_option('display.max_rows', 1000)
pd.set_option('display.max_columns', 100)
Load the processed neural data¶
In [2]:
df = pd.read_csv('processed_QC_passed_2024-07-04_collected_v1.csv')
In [3]:
df.shape
Out[3]:
In [4]:
df.head()
Out[4]:
1. Does capacitance change with age?¶
- Compute the capacitance by patient age, and plot it
- Does it change with age? (eyeballing is enough)
In [5]:
df.groupby('patient_age')['capacitance'].mean().plot(ls='', marker='.')
Out[5]:
2. Spiking threshold after potassium incubation¶
- Does the spiking threshold (TH) change between Day 1 and Day 2?
- Does this result depend on the treatment?
In [6]:
df.groupby('day')['TH'].mean()
Out[6]:
In [7]:
th_per_treatment_and_day = df.pivot_table(index='treatment', columns='day', values='TH', aggfunc='mean')
In [8]:
th_per_treatment_and_day
Out[8]:
In [9]:
th_per_treatment_and_day = df.pivot_table(index='treatment', columns='day', values='TH', aggfunc=['mean', 'std'])
th_per_treatment_and_day
Out[9]:
In [ ]: