'(name)' is not one of the example datasets.
Package:
seaborn
8730
Exception Class:
ValueError
Raise code
url = f"https://raw.githubusercontent.com/mwaskom/seaborn-data/master/{name}.csv"
if cache:
cache_path = os.path.join(get_data_home(data_home), os.path.basename(url))
if not os.path.exists(cache_path):
if name not in get_dataset_names():
raise ValueError(f"'{name}' is not one of the example datasets.")
urlretrieve(url, cache_path)
full_path = cache_path
else:
full_path = url
df = pd.read_csv(full_path, **kws)
Links to the raise (1)
https://github.com/mwaskom/seaborn/blob/78e9c0800514b30b1e89a47db58e3f564ee51903/seaborn/utils.py#L580Ways to fix
This exception is raised when the wrong is given while loading example data set from seaborn.
Steps to reproduce the exception:
import seaborn
data = seaborn.load_dataset(name = "penguin")
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-4-72abfc038c3c> in <module>() ----> 1 data = seaborn.load_dataset(name = "penguin")
/usr/local/lib/python3.7/dist-packages/seaborn/utils.py in load_dataset(name, cache, data_home, **kws) 593 if not os.path.exists(cache_path): 594 if name not in get_dataset_names(): --> 595 raise ValueError(f"'{name}' is not one of the example datasets.") 596 urlretrieve(url, cache_path) 597 full_path = cache_path
ValueError: 'penguin' is not one of the example datasets.
Fixed version of the code:
import seaborn
data = seaborn.load_dataset(name = "penguins")
print(data)
Add a possible fix
Please authorize to post fix