Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

File is not a ZipFile #19

Open
jennymansour96 opened this issue Jun 13, 2018 · 7 comments
Open

File is not a ZipFile #19

jennymansour96 opened this issue Jun 13, 2018 · 7 comments

Comments

@jennymansour96
Copy link

Hello,

When trying to run the py file in the example folder, I get the following error and can't fix it. Does someone have anything to help ?
zipfile.BadZipfile: File is not a zip file

The error is on this line :

tr = zipfile.ZipFile(ds.open(URL_TR % subject))

Thank you !

@breuderink
Copy link
Owner

breuderink commented Jul 14, 2018

Strange, I just tried the example. It indeed fails on Python 2. I don't know what is going on. The zip file that is downloaded (in eegtools_data/bbci.de/competition/download/competition_iii/berlin/100Hz) is a valid zip file. But Python doesn't like it. It used to work for years, and I don't think much was changed...

The SO post https://stackoverflow.com/questions/4923142 suggest that this happens also in other cases.

@breuderink
Copy link
Owner

See also #7. This is the source of most issues...

@breuderink
Copy link
Owner

Closing this. The discussion on #7 is most elaborate. When reading through all the comments it seems to happen with specific Python versions.

@Irving-ren
Copy link

@breuderink

Hi,I'm working with Anaconda on Ubuntu python 2.7 and it occurred the same problem when trying eegtools.
screenshot from 2018-08-20 11-07-37

Do you know the reason of this problem? Thank you!that means a lot to me.

Best
Irving

@breuderink breuderink reopened this Aug 24, 2018
@breuderink
Copy link
Owner

I believe that the zip file is slightly corrupt, leading to undefined behaviour. See for example the discussion in https://stackoverflow.com/questions/4923142/zipfile-cant-handle-some-type-of-zip-data. I don't know how to fix this on my end.

@Irving-ren
Copy link

@breuderink Thanks for your reply. The problem have already been solved. However, I am still having one confusion about CSP feature extraction method. Is this CSP just available for the classification of two classes? how about multi-class case with JAD?
Best
Irving

@breuderink
Copy link
Owner

Just two classes. I suggest to use the approach presented in [1] for multiple classes, it is much more elegant.

[1] Roijendijk, Linsey, Stan Gielen, and Jason Farquhar. "Classifying regularized sensor covariance matrices: an alternative to CSP." IEEE Transactions on Neural Systems and Rehabilitation Engineering 24.8 (2016): 893-900.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants