PTSA - EEG Time Series Analysis in Python

PTSA is an open source Python package that facilitates time-series analysis of EEG signals. PTSA builds on xarray functionality and provides several convenience tools that significantly simplify analysis of EEG data.

The main object that you will be using in the new PTSA API is called TimeSeries. TimeSeries is built on top of xarray.DataArray. xarray.DataArray, defined in the xarray Python package, represents N-D arrays. Because TimeSeries is a subclass of xarray.DataArray it has all the functionality of xarray.DataArray in addition to new functions it defines, used specifically in EEG data analysis.

Besides TimeSeries, PTSA has 2 main categories of objects: readers and filters. Readers read various data formats (EEG files, event files, etc.) to make input operations as smooth as possible. Filters take a TimeSeries object as an input and output a modified TimeSeries object.

If you’d like to learn Python via series of statistics tutorials look no further than introduction to computational statistics in Python

Installation

Installing pre-built binaries

The recommended way to install ptsa is to install with conda:

conda install -c pennmem ptsa

Installing with conda from source

If you’d rather install the latest development version, you’ll need to perform the following steps:

Clone the git repository:

git clone https://github.com/pennmem/ptsa.git

Install dependencies with conda:

conda install -y numpy scipy xarray swig

Install PTSA:

python setup.py install

Optional dependencies

For netCDF and IO

  • netCDF4: recommended if you want to use xarray for reading or writing netCDF files

  • h5netcdf: an alternative library for reading and writing netCDF4 files that does not use the netCDF-C libraries

Contents