Seaborn 的示例數據集(load_dataset)
相信大家在學習GroupBy,或者數據透視表時,都有可能會碰到類似下面的一行代碼:
import seaborn as sns
planets = sns.load_dataset('planets')
然后就可以發現planets已經存儲了數據了,那么這些數據到底是從哪里來的呢?
我們查看一下load_dataset的docstring:
In [54]: sns.load_dataset??
Signature: sns.load_dataset(name, cache=True, data_home=None, **kws)
Source:
def load_dataset(name, cache=True, data_home=None, **kws):
"""Load a dataset from the online repository (requires internet).
Parameters
----------
name : str
Name of the dataset (`name`.csv on
https://github.com/mwaskom/seaborn-data). You can obtain list of
available datasets using :func:`get_dataset_names`
cache : boolean, optional
If True, then cache data locally and use the cache on subsequent calls
data_home : string, optional
The directory in which to cache data. By default, uses ~/seaborn-data/
kws : dict, optional
Passed to pandas.read_csv
"""
可以看到docstring的第一行就說明了這個函數是從在線存儲庫加載數據集的(需要互聯網)。
網址:我是GitHub
下面就是可以在線或取得數據集啦(可以用來做練習哦)