I am conducting an analysis called “Lempel Ziv complexity” (LZ), on neurological data. My data files are made up of an array of numbers, where each column is a sample (time) and each row is a channel (input location).
I want to use this Python script (written by another researcher):
[login to view URL]
I want to execute the LZc and LZs functions on each of my data files and output/save the results, for further statistical analysis.
The code will need some modification, as I believe it is designed to operate on a single “epoch” (time range). My data files are made up of multiple epochs, each epoch being 1001 samples (columns). So the LZ function will need to start again after 1001 columns, and output/save the LZ result for each epoch.
The LZc function should output one result for each epoch, so each data file should produce a linear set of LZc results (one for each epoch).
The LZs function will output a result for each channel (row), so each data file should produce a matrix of LZs results (one for each channel for each epoch).
The updated Py script should be provided, once it has been tested and verified on the sample data file I have uploaded
Further, I have not worked with Python before. So once the code has been modified, I need simple step-by-step instructions on how to:
- setup iPython (or other) to import/handle the data
- import the data files
- load the script
- execute the functions LZc and LZs (and any other functions necessary)
- copy/save the results
- any other necessary operations