]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
Open a data file
authorEdward Delaporte <delaport@illinois.edu>
Fri, 16 Feb 2024 14:20:35 +0000 (08:20 -0600)
committerEdward Delaporte <delaport@illinois.edu>
Fri, 16 Feb 2024 14:20:35 +0000 (08:20 -0600)
data/issues.ipynb
data/requirements.txt [new file with mode: 0644]

index 2156a71641d394dd000abcfcfbb8dd15604f0a90..b731ad103201a471bf606afa37caa395c483d885 100644 (file)
@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 21,
+   "execution_count": 2,
    "metadata": {},
    "outputs": [],
    "source": [
     "import glob\n",
     "import os\n",
     "\n",
-    "data_files = glob.glob(os.path.expanduser('~\\\\Data\\\\*.json'))"
+    "data_files = glob.glob(os.path.expanduser('~\\\\Data\\\\*.json'))\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3.12.2\n"
+     ]
+    }
+   ],
+   "source": [
+    "import platform\n",
+    "print(platform.python_version())"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "\n",
+    "data_sets = []\n",
+    "\n",
+    "file = data_files[0]\n",
+    "print(file)\n",
+    "\n",
+    "f = open(file, encoding='utf-16')\n",
+    "data = pd.read_json(f)\n",
+    "\n",
+    "print(data)\n"
    ]
   }
  ],
@@ -30,7 +67,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.12.1"
+   "version": "3.12.2"
   }
  },
  "nbformat": 4,
diff --git a/data/requirements.txt b/data/requirements.txt
new file mode 100644 (file)
index 0000000..1f7d68e
--- /dev/null
@@ -0,0 +1,4 @@
+ipykernel
+jupyter_core
+pandas
+pyarrow
\ No newline at end of file