0

I am working on a dataset to visualize basic plots in python. I use seaborn and matplotlib. Up until yesterday, the packages worked perfectly fine until this error showed up:

stars = sns.load_dataset(vcsfeatures)
sns.boxplot(stars)
plt.xlim(-100, 8000, 500)
plt.show()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/seaborn/utils.py", line 424, in load_dataset
    urlretrieve(full_path, cache_path)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 248, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

I searched on this platform and all answers came from-out the intention to utilize a url or to get access to a web api.

This error occurs when i use simple plot code:

pd.DataFrame.boxplot(vcsfeatures)
pd.DataFrame.boxplot(userfeatures)
plt.ylim(-100, 1800)
plt.show()

also with fake data as data = [1, 2, 3] I get this error whenever i try to call for a plotting library.

This used to work yesterday. Also with seaborn, pandas and numpy the error comes up.

What am I missing here in finding the solution?

If there is a question like this already, please redirect me as I am not able to find it.

Dimq
  • 21
  • 6

1 Answers1

2

sns.load_dataset requires a string as argument which evaluates to one of the available datasets at https://github.com/mwaskom/seaborn-data.

E.g. sns.load_dataset("tips") would load the tips.csv file.

Also see Seaborn load_dataset

Supplying some other data or a string which does not have its corresponding file will of course not work.

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
  • My question is not bounded to the seaborn package. it happens also with matplotlib. even if i use matplotlib without seaborn. :( – Dimq May 31 '17 at 21:12
  • I can only answer on what you provide in the question. If it's not seaborn related, why do you post a seaborn code? – ImportanceOfBeingErnest May 31 '17 at 21:13
  • I think that i show you also solely a `.plt` in my question to show that it is not only seaborn. – Dimq May 31 '17 at 21:15
  • 2
    It 100% certain that the error you show is related to seaborn, because the error traceback says so. If you have a problem without seaborn, post the code and the error traceback you get with **that other code**. – ImportanceOfBeingErnest May 31 '17 at 21:16
  • ahh! your 100% is better than mine. it worked! Thank youu, i am very happy. – Dimq May 31 '17 at 21:28