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

下面就是可以在线或取得数据集啦(可以用来做练习哦)

Seaborn 的示例数据集(load_dataset)


相关文章:

  • 2022-01-08
  • 2022-03-07
  • 2021-09-19
  • 2022-01-23
  • 2021-09-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-04
  • 2021-09-29
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案