Chinesh
Chinesh

Reputation: 135

Error while loading graphlab.SFrame('home_data.gl/')

I am doing Machine Learning Course from Coursera by University of Washington. In which I am using iPython's graphlab. During practise when I execute below command:

sales = graphlab.SFrame('home_data.gl/')

I am getting error.

    IOError                                   Traceback (most recent call last)
<ipython-input-2-e6a249ea422b> in <module>()
----> 1 sales = graphlab.SFrame('home_data.gl/')

C:\Users\chinesh\Anaconda2\envs\gl-env\lib\site-packages\graphlab\data_structures\sframe.pyc in __init__(self, data, format, _proxy)
    951                     pass
    952                 else:
--> 953                     raise ValueError('Unknown input type: ' + format)
    954 
    955         sframe_size = -1

C:\Users\chinesh\Anaconda2\envs\gl-env\lib\site-packages\graphlab\cython\context.pyc in __exit__(self, exc_type, exc_value, traceback)
     47             if not self.show_cython_trace:
     48                 # To hide cython trace, we re-raise from here
---> 49                 raise exc_type(exc_value)
     50             else:
     51                 # To show the full trace, we do nothing and let exception propagate

IOError: C:\Users\chinesh\home_data.gl not found.

where i can find home_data.gl in my computer or the problem is something else ..

Upvotes: 1

Views: 1838

Answers (3)

Sunil Manheri
Sunil Manheri

Reputation: 2363

Just follow the instructions and download the training data into the ipython working directory.

Go to terminal and run:

unzip home_data.gl.zip

You will see following files in directory home_data.gl:

enter image description here

Now in ipython, run:

sales = graphlab.SFrame('home_data.gl/')
sales

which will display the data in tabular format:

enter image description here

Upvotes: 0

Meh
Meh

Reputation: 369

Make sure to download the zip folder to the same folder where you will work on this data. For example: I downloaded the zip file to Downloads then I opened my notebook from the download file

Upvotes: 1

DCMoore
DCMoore

Reputation: 51

You need to have your ipynb file and the data file in the same directory for the above to work. Alternatively, specify the full or relative path of the data file in the function

sales = graphlab.SFrame('C:\FULL-PATH\home_data.gl/')

Here is a link to the course reading for how to arrange your directories for the course. https://www.coursera.org/learn/ml-foundations/supplement/IT04V/reading-where-should-my-files-go

Upvotes: 1

Related Questions