{"cells": [{"execution_count": null, "metadata": {"_uuid": "a328bcea50c84c74e4e95efa549bd235f6d60603", "collapsed": true, "_cell_guid": "02c4f463-83ce-e813-b3b6-2114ce87af1f"}, "cell_type": "code", "source": ["# This Python 3 environment comes with many helpful analytics libraries installed\n", "# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n", "# For example, here's several helpful packages to load in \n", "\n", "import numpy as np # linear algebra\n", "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n", "\n", "# Input data files are available in the \"../input/\" directory.\n", "# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n", "\n", "from subprocess import check_output\n", "print(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n", "\n", "# Any results you write to the current directory are saved as output."], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "3290d6db3465d9aac748da9d2d01b8582f493b29", "collapsed": true, "_cell_guid": "e6da78ef-269a-1bf1-93c8-886bacf363be"}, "cell_type": "code", "source": ["import os\n", "os.listdir(\"../\")"], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "b322f3303da6c5b2c2b609116aec44bfe2fc047a", "collapsed": true, "_cell_guid": "030d09e5-7e85-2c0c-3597-bf62f6358536"}, "cell_type": "code", "source": ["pwd"], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "c47fa91e27a2b91d69064da86cd00d87e56dd3c3", "collapsed": true, "_cell_guid": "1fde4cff-7e27-4f09-80dc-4b5ded892344"}, "cell_type": "code", "source": ["basepath = '../input/train/'\n", "os.listdir(basepath)"], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "a1bb27afa59f53df1ecf5afd6f1a3507c0c03228", "collapsed": true, "_cell_guid": "ec0fced4-0fa2-a532-3ff7-e122831b78f1"}, "cell_type": "code", "source": ["cd '../input/train/'"], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "9973ed3ffb9507636f1388e21c4a9b73b27aaec9", "collapsed": true, "_cell_guid": "290b1e0a-282f-8f2f-aae0-4fa9818e1086"}, "cell_type": "code", "source": ["os.listdir()"], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "148796381f2f2f0d64e96378014707cd7fa867fa", "collapsed": true, "_cell_guid": "653ff242-7ead-9b7e-ccb7-7f556d3cb538"}, "cell_type": "code", "source": ["from glob import glob\n", "basepath = './'\n", "\n", "all_cervix_images = []\n", "\n", "for path in sorted(glob(basepath + \"*\")):\n", "    cervix_type = path.split(\"/\")[-1]\n", "    cervix_images = sorted(glob(basepath + cervix_type + \"/*\"))\n", "    all_cervix_images = all_cervix_images + cervix_images\n"], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "851625c786bbff65c3dbee96605fda70957fc80c", "collapsed": true, "_cell_guid": "53820e5b-4123-4997-80cf-e94529c4c269"}, "cell_type": "code", "source": ["#cervix_type\n", "all_cervix_images[0]"], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "0dcd27f2dda93170397b2a08b18c745a80301783", "collapsed": true, "_cell_guid": "73e7feff-b5cd-53fe-cc47-98c863390839"}, "cell_type": "code", "source": ["os.listdir('./Type_1')"], "outputs": []}, {"execution_count": null, "metadata": {"_uuid": "6c96b99926accbbef5dccc7a8c3c5cc0148c9f09", "collapsed": true, "_cell_guid": "c88e1716-92d8-2823-93bc-0299b7fc1900"}, "cell_type": "code", "source": ["pwd"], "outputs": []}], "nbformat": 4, "metadata": {"language_info": {"version": "3.6.1", "mimetype": "text/x-python", "file_extension": ".py", "nbconvert_exporter": "python", "codemirror_mode": {"version": 3, "name": "ipython"}, "pygments_lexer": "ipython3", "name": "python"}, "kernelspec": {"display_name": "Python 3", "name": "python3", "language": "python"}, "_is_fork": false, "_change_revision": 0}, "nbformat_minor": 1}