Giter VIP home page Giter VIP logo

Comments (6)

iamaziz avatar iamaziz commented on August 14, 2024

Hey thanks for reporting this. Unfortunately, I don't have access to a windows machine at the moment :/
But it seems a unicode-related error in the string you passed to data().

Since the file already exists (otherwise it would be an OSError) but the passed string didn't match its actual dataset_id name (although they appear with the same letters), the only thing I could think of is the character properties.

Could you verify the string type before you pass it to data()?
Hope if someone has tried this on Win could bring some more insight into this as well.

I tried to produce this error by changing the string to unicode('utf-8'), and got the same error:

>>> data('iris'.encode('utf-8'))
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    data('iris'.encode('utf-8'))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pydataset/__init__.py", line 36,
 in data
    raise Exception('Wrong dataset name! Try: data() to see available.')
Exception: Wrong dataset name! Try: data() to see available.

from pydataset.

rafguns avatar rafguns commented on August 14, 2024

From a quick look, it seems like this is caused by the forward slashes in https://github.com/iamaziz/PyDataset/blob/master/pydataset/locate_datasets.py#L39 and further.
Separator on Windows is r'\' so these should be replaced by os.path.sep.

from pydataset.

iamaziz avatar iamaziz commented on August 14, 2024

Yep that's was the issue thanks @rafguns
It should be ok now, please update to 0.1.1 and check it out.

from pydataset.

coryandrewtaylor avatar coryandrewtaylor commented on August 14, 2024

It's working as expected now. Thanks!

On Tue, Feb 2, 2016 at 12:30 PM, Aziz Alto [email protected] wrote:

Closed #1 #1.


Reply to this email directly or view it on GitHub
#1 (comment).

from pydataset.

nikolas1301 avatar nikolas1301 commented on August 14, 2024

I'm having the same problem as cory. I'm using python 3.6.2 and win 10.

`Traceback (most recent call last):
File "C:\Users\nikol\PycharmProjects\MachineLearning3\venv\lib\site-packages\pydataset_init_.py", line 34, in data
df = __read_csv(item)
File "C:\Users\nikol\PycharmProjects\MachineLearning3\venv\lib\site-packages\pydataset\datasets_handler.py", line 47, in __read_csv
path = __get_csv_path(item)
File "C:\Users\nikol\PycharmProjects\MachineLearning3\venv\lib\site-packages\pydataset\datasets_handler.py", line 43, in __get_csv_path
return items[item]
KeyError: 'Titanic'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/nikol/PycharmProjects/MachineLearning3/AulaPydata.py", line 7, in
titanic = pydataset.data('Titanic')
File "C:\Users\nikol\PycharmProjects\MachineLearning3\venv\lib\site-packages\pydataset_init_.py", line 37, in data
find_similar(item)
File "C:\Users\nikol\PycharmProjects\MachineLearning3\venv\lib\site-packages\pydataset\support.py", line 48, in find_similar
raise Exception(ERROR)
Exception: Not valid dataset name and no similar found! Try: data() to see available.`

from pydataset.

Sandy4321 avatar Sandy4321 commented on August 14, 2024

so there is solution?

from pydataset.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.