File size: 847 Bytes
8a3ec2f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Split data into normal and abnormal fundus photo\n",
    "import pandas as pd\n",
    "\n",
    "label_df = pd.read_csv(\"RFMiD_Training_Labels.csv\")\n",
    "label_df.head()\n",
    "\n",
    "import  shutil\n",
    "\n",
    "for index,row in label_df.iterrows():\n",
    "    at_risk = row['Disease_Risk']\n",
    "    file = str(row[\"ID\"])+\".png\"\n",
    "    path = \"Training\"\n",
    "    file_path = path+\"/\"+file\n",
    "\n",
    "    if not at_risk:\n",
    "        shutil.copy(file_path, \"../normal/\")\n",
    "    else:\n",
    "        shutil.copy(file_path, \"../abnormal/\")"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}