{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[],"dockerImageVersionId":30646,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"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\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\n\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-02-27T13:05:58.713756Z","iopub.execute_input":"2024-02-27T13:05:58.716874Z","iopub.status.idle":"2024-02-27T13:05:58.730598Z","shell.execute_reply.started":"2024-02-27T13:05:58.716709Z","shell.execute_reply":"2024-02-27T13:05:58.727856Z"},"trusted":true},"execution_count":2,"outputs":[]},{"cell_type":"code","source":"import os\nimport pandas as pd\n\n# Define the input directory path\ninput_dir = '../input/aptos2019-blindness-detection/train.csv'\n\n# List all files under the input directory\nfor dirname, _, filenames in os.walk(input_dir):\n    for filename in filenames:\n        # Construct the full file path\n        file_path = os.path.join(dirname, filename)\n        \n        # Check if the file is a CSV file\n        if file_path.endswith('blindness-detection/train.csv'):\n            print(f\"Reading data from: {file_path}\")\n            \n            # Read the CSV file into a pandas DataFrame\n            data = pd.read_csv(file_path)\n            \n            # Display the first few rows of the DataFrame\n            print(data.head())\n            print('\\n')\n","metadata":{"execution":{"iopub.status.busy":"2024-02-27T13:10:32.171081Z","iopub.execute_input":"2024-02-27T13:10:32.171633Z","iopub.status.idle":"2024-02-27T13:10:32.180868Z","shell.execute_reply.started":"2024-02-27T13:10:32.171596Z","shell.execute_reply":"2024-02-27T13:10:32.179278Z"},"trusted":true},"execution_count":5,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\n# Define the input file path\ninput_file = '../input/aptos2019-blindness-detection/train.csv'\n\n# Check if the file exists\nif os.path.isfile(input_file):\n    print(f\"Reading data from: {input_file}\")\n    \n    # Read the CSV file into a pandas DataFrame\n    data = pd.read_csv(input_file)\n    \n    # Display the first few rows of the DataFrame\n    print(data.head())\n    print('\\n')\nelse:\n    print(f\"File not found: {input_file}\")\n","metadata":{"execution":{"iopub.status.busy":"2024-02-27T13:11:39.553403Z","iopub.execute_input":"2024-02-27T13:11:39.553891Z","iopub.status.idle":"2024-02-27T13:11:39.563058Z","shell.execute_reply.started":"2024-02-27T13:11:39.553857Z","shell.execute_reply":"2024-02-27T13:11:39.56136Z"},"trusted":true},"execution_count":6,"outputs":[{"name":"stdout","text":"File not found: ../input/aptos2019-blindness-detection/train.csv\n","output_type":"stream"}]}]}