fail to load arff file in python
Question: I am quite sure that my arff files are correct, for that I have downloaded
different files on the web and successfully opened them in Weka.

But I want to use my data in python, then I typed:

    
    
    import arff
    data = arff.load('file_path','rb')
    

It always returns an error message: _Invalid layout of the ARFF file_ , at
line 1.

Why this happened and how should I do to make it right?


Answer: If you change your code like in below, it'll work.

    
    
    import arff
    data = arff.load(open('file_path'))
    

