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的第一行就说明了这个函数是从在线存储库加载数据集的(需要互联网)。

网址:https://github.com/mwaskom/seaborn-data

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

 

 

 

  • 16
    点赞
  • 38
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值