This commit is contained in:
s434766 2021-03-28 20:50:30 +02:00
parent f68b542c5e
commit 839e258785

View File

@ -24,7 +24,7 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 14, "execution_count": 31,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -36,17 +36,17 @@
} }
], ],
"source": [ "source": [
"import requests, zipfile, io\n", "import kaggle\n",
"import os\n",
"import numpy as np\n", "import numpy as np\n",
"import pandas as pd\n", "import pandas as pd\n",
"from sklearn.preprocessing import MinMaxScaler\n", "from sklearn.preprocessing import MinMaxScaler\n",
"from sklearn.model_selection import train_test_split\n", "from sklearn.model_selection import train_test_split\n",
"\n", "\n",
"def downloadCSV():\n", "def downloadCSV():\n",
" url = 'https://storage.googleapis.com/kaggle-data-sets/1120859/1882037/bundle/archive.zip?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=gcp-kaggle-com%40kaggle-161607.iam.gserviceaccount.com%2F20210318%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20210318T160935Z&X-Goog-Expires=259199&X-Goog-SignedHeaders=host&X-Goog-Signature=80121539e91aa375f41f0e845d30223b55c8da5f99a681164ca4e3b3688a6d31694701a7c3afd623dd8826b750e23aa8d16c2eb0387679596319568d7d203889c92bfd21ba8e304909484e0c1d420aea183ae8a2ec2a6b9eba6137bd79b0ddf7925a48db27aa4cc4bf4ec34b659fcaf62c575468a52dc410485340ce00d6a70be0eee52b9728fb023252f4320c5328c6ed90ec9d850fd03122bf92f81edb8f9a6c49d72502955221740362bf83561265d6278dbddbb2279ad6fe3e27e6e2d0e4772a7f4a0c787b7222c359b222c1b457b4b548361b0f12a7012f26c2d495072ccc263b0e7ddd73b617afe4eaf1704a4a295f00f94e0768c83f4fc484856f1c9a'\n", " kaggle.api.authenticate()\n",
" r = requests.get(url)\n", " kaggle.api.dataset_download_files('fedesoriano/stroke-prediction-dataset', path='.', unzip=True)\n",
" z = zipfile.ZipFile(io.BytesIO(r.content))\n", " data = pd.read_csv('healthcare-dataset-stroke-data.csv')\n",
" z.extractall()\n",
"\n", "\n",
"def dropNaN():\n", "def dropNaN():\n",
" data = pd.read_csv('healthcare-dataset-stroke-data.csv')\n", " data = pd.read_csv('healthcare-dataset-stroke-data.csv')\n",