当前位置:网站首页>pycaret源码分析:下载数据集\Lib\site-packages\pycaret\datasets.py
pycaret源码分析:下载数据集\Lib\site-packages\pycaret\datasets.py
2022-08-01 00:00:00 【人工智能曾小健】

def get_data(
dataset="index",
save_copy=False,
profile=False,
verbose=True,
address="https://raw.githubusercontent.com/pycaret/pycaret/master/datasets/",
):
"""
This function loads sample datasets from git repository. List of available
datasets can be checked using ``get_data('index')``.
Example
-------
>>> from pycaret.datasets import get_data
>>> all_datasets = get_data('index')
>>> juice = get_data('juice')
dataset: str, default = 'index'
Index value of dataset.
save_copy: bool, default = False
When set to true, it saves a copy in current working directory.
profile: bool, default = False
When set to true, an interactive EDA report is displayed.
verbose: bool, default = True
When set to False, head of data is not displayed.
address: string, default = "https://raw.githubusercontent.com/pycaret/pycaret/master/datasets/"
Download url of dataset. For people have difficulty linking to github, they can change
the default address to their own (e.g. "https://gitee.com/IncubatorShokuhou/pycaret/raw/master/datasets/")
Returns:
pandas.DataFrame
Warnings
--------
- Use of ``get_data`` requires internet connection.
"""
import pandas as pd
import os.path
from IPython.display import display, HTML, clear_output, update_display
extension = ".csv"
filename = str(dataset) + extension
complete_address = address + filename
if os.path.isfile(filename):
data = pd.read_csv(filename)
else:
data = pd.read_csv(complete_address)
# create a copy for pandas profiler
data_for_profiling = data.copy()
if save_copy:
save_name = filename
data.to_csv(save_name, index=False)
if dataset == "index":
display(data)
else:
if profile:
import pandas_profiling
pf = pandas_profiling.ProfileReport(data_for_profiling)
display(pf)
else:
if verbose:
display(data.head())
return data
边栏推荐
猜你喜欢

程序进程和线程(线程的并发与并行)以及线程的基本创建和使用

一体化步进电机在无人机自动机场的应用

Shell常用脚本:Nexus批量上传本地仓库脚本

C# Rectangle basic usage and picture cutting
![[Cloud Residency Co-Creation] [HCSD Big Celebrity Live Broadcast] Personally teach the secrets of interviews in big factories](/img/7a/278ffada1cc660e7f5c2d7c66fa38e.png)
[Cloud Residency Co-Creation] [HCSD Big Celebrity Live Broadcast] Personally teach the secrets of interviews in big factories

手写一个简单的web服务器(B/S架构)

cobaltstrike

游戏安全03:缓冲区溢出攻击简单解释

《ArchSummit:时代的呐喊,技术人听得到》
![[MATLAB project combat] LDPC-BP channel coding](/img/37/4777e4d05cb2dbb1865f1d05ae9878.png)
[MATLAB project combat] LDPC-BP channel coding
随机推荐
What is customer profile management?
MySQL数据库‘反斜杠\’ ,‘单引号‘’,‘双引号“’,‘null’无法存储
Flutter教程之 01配置环境并运行demo程序 (教程含源码)
SQL injection Less38 (stack injection)
2022年CSP-J1 CSP-S1 第1轮初赛 报名指南
[Reading Notes -> Data Analysis] 02 Data Analysis Preparation
TypeScript 的组件
SQL注入 Less42(POST型堆叠注入)
leetcode:126. 单词接龙 II
基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
一行代码解决CoreData托管对象属性变更在SwiftUI中无动画效果的问题
Network security - crack WiFi through handshake packets (detailed tutorial)
一文概述:VPN的基本模型及业务类型
简单的vim配置
类和对象:上
Kyoto University:Masaki Waga | 黑箱环境中强化学习的动态屏蔽
lua入门案例实战123DIY
MLP神经网络,GRNN神经网络,SVM神经网络以及深度学习神经网络对比识别人体健康非健康数据
继承的注意事项
/usr/local/bin和/usr/bin的区别