{ "cells": [ { "cell_type": "markdown", "id": "f3ff5f14-407b-4c84-b0f2-da1bfe56b178", "metadata": {}, "source": [ "# Load csv tracks files\n", "Many track data, including output from TempestExtremes, are provided in a csv format, where each row is an observation (cyclone point in space and time), and each column is an attribute. " ] }, { "cell_type": "code", "execution_count": null, "id": "cee69883-fc8b-4b45-9891-b35c1ff73a24", "metadata": {}, "outputs": [], "source": [ "import huracanpy" ] }, { "cell_type": "code", "execution_count": null, "id": "3e782196-66fc-4486-bfcd-9e008e8c6688", "metadata": {}, "outputs": [], "source": [ "# Example csv file\n", "filename = huracanpy.example_csv_file\n", "filename" ] }, { "cell_type": "code", "execution_count": null, "id": "8e6e0cd3-ddf1-48aa-a84a-9c06d74c4e05", "metadata": {}, "outputs": [], "source": [ "# File content\n", "with open(filename, \"r\") as csv:\n", " for i in range(5):\n", " print(csv.readline())" ] }, { "cell_type": "code", "execution_count": null, "id": "60d878db-4636-4aa3-8245-680c22dff788", "metadata": {}, "outputs": [], "source": [ "# Load with huracanpy\n", "huracanpy.load(filename, source=\"csv\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.4" } }, "nbformat": 4, "nbformat_minor": 5 }