2024-heraklion-data/exercises/pandas_intro/.ipynb_checkpoints/pandas_intro-checkpoint.ipynb
2024-08-27 15:27:53 +03:00

4.5 KiB

Exercise: Have a look at the neural data using Pandas

In [1]:
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 electrophysiology data

In [2]:
df = pd.read_csv('../../data/QC_passed_2024-07-04_collected.csv')

1. How many rows/columns does the data set have?

In [ ]:

2. Display the first 5 rows of the DataFrame

In [ ]:

3. Display the names and dtypes of all the columns

In [ ]:

4. Display the unique values of the high K concentration and of the treatment columns

In [ ]:

5. Display the main statistics of the max_spikes column

In [ ]:

6. Show all the rows where the max number of spikes is larger than 50

In [ ]:

7. Display the main statistics of 'max_spikes', for the rows where high K concentration is 8 mM and 15 mM (separately)

Are the distributions any different?

In [ ]:

8. Display the statistics of max_spikes when high K concentration is 8 mM, and the maximum number of spikes is <= 100

Does that change your conclusion?

In [ ]:

9. Transform the high K concentration column into a numerical column

a) Discard the last three characters of the columns (' mM')

b) Use .astype(float) to convert to floating point numbers

c) Save the result in a column K (mM)

In [ ]:

In [ ]: