File size: 9,610 Bytes
f4355cb |
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "cd0be85b",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import csv"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "39c3d028",
"metadata": {},
"outputs": [],
"source": [
"# columns: id, timestamp, "
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "a7621921",
"metadata": {},
"outputs": [],
"source": [
"from datetime import datetime"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "bb10b577",
"metadata": {},
"outputs": [],
"source": [
"ts_list = []\n",
"with open(r\"C:\\Users\\yozhan\\Downloads\\Archive\\Bitcoin copy\\BitCoinsubmission4.csv\", \"r\", encoding=\"utf-8\") as infile:\n",
" csv_reader = csv.reader(infile, delimiter=' ', quotechar='|')\n",
" for row in csv_reader:\n",
" ts = row[1]\n",
" ts_list.append(ts)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fe289999",
"metadata": {},
"outputs": [],
"source": [
"# Bitcoin\n",
"# submission1 2022-01-01 - 2022-03-01\n",
"# submission2 2022-03-01 - 2022-06-01\n",
"# submission3 2022-06-01 - 2022-09-01\n",
"# submission4 2022-09-01 - 2023-01-01"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "4fc8a065",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"11927\n",
"2022-09-01 00:59:41\n",
"2023-01-01 23:51:53\n"
]
}
],
"source": [
"print(len(ts_list))\n",
"print(datetime.fromtimestamp(float(min(ts_list))))\n",
"print(datetime.fromtimestamp(float(max(ts_list))))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fc4c9d89",
"metadata": {},
"outputs": [],
"source": [
"# Ethereum\n",
"# submission1 2022-01-01 - 2022-03-01: 4481\n",
"# submission2 2022-03-01 - 2022-06-01: 3837\n",
"# submission3 2022-06-01 - 2022-09-01: 3172\n",
"# submission4 2022-09-01 - 2023-01-01: 4418"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "52ad83de",
"metadata": {},
"outputs": [],
"source": [
"ts_list = []\n",
"with open(r\"C:\\Users\\yozhan\\Downloads\\Archive\\Etherum copy\\Ethereumsubmission4.csv\", \"r\", encoding=\"utf-8\") as infile:\n",
" csv_reader = csv.reader(infile, delimiter=' ', quotechar='|')\n",
" for row in csv_reader:\n",
" ts = row[1]\n",
" ts_list.append(ts)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "244fdfe5",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4418\n",
"2022-09-01 01:02:11\n",
"2023-01-01 23:00:11\n"
]
}
],
"source": [
"print(len(ts_list))\n",
"print(datetime.fromtimestamp(float(min(ts_list))))\n",
"print(datetime.fromtimestamp(float(max(ts_list))))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3bf7d52e",
"metadata": {},
"outputs": [],
"source": [
"# Dogecoin\n",
"# submission1 2022-01-01 - 2022-03-01: 11126\n",
"# submission2 2022-03-01 - 2022-06-01: 21513\n",
"# submission3 2022-06-01 - 2022-09-01: 10098\n",
"# submission4 2022-09-01 - 2023-01-01: ??"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "8fb1550b",
"metadata": {
"scrolled": true
},
"outputs": [
{
"ename": "FileNotFoundError",
"evalue": "[Errno 2] No such file or directory: 'C:\\\\Users\\\\yozhan\\\\Downloads\\\\Archive\\\\Dogecoin copy\\\\Dogecoinsubmission4.csv'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[40], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m ts_list \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;124;43mr\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mC:\u001b[39;49m\u001b[38;5;124;43m\\\u001b[39;49m\u001b[38;5;124;43mUsers\u001b[39;49m\u001b[38;5;124;43m\\\u001b[39;49m\u001b[38;5;124;43myozhan\u001b[39;49m\u001b[38;5;124;43m\\\u001b[39;49m\u001b[38;5;124;43mDownloads\u001b[39;49m\u001b[38;5;124;43m\\\u001b[39;49m\u001b[38;5;124;43mArchive\u001b[39;49m\u001b[38;5;124;43m\\\u001b[39;49m\u001b[38;5;124;43mDogecoin copy\u001b[39;49m\u001b[38;5;124;43m\\\u001b[39;49m\u001b[38;5;124;43mDogecoinsubmission4.csv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mr\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mutf-8\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m infile:\n\u001b[0;32m 3\u001b[0m csv_reader \u001b[38;5;241m=\u001b[39m csv\u001b[38;5;241m.\u001b[39mreader(infile, delimiter\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m'\u001b[39m, quotechar\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m|\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 4\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m row \u001b[38;5;129;01min\u001b[39;00m csv_reader:\n",
"File \u001b[1;32m~\\AppData\\Local\\anaconda3\\lib\\site-packages\\IPython\\core\\interactiveshell.py:282\u001b[0m, in \u001b[0;36m_modified_open\u001b[1;34m(file, *args, **kwargs)\u001b[0m\n\u001b[0;32m 275\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m file \u001b[38;5;129;01min\u001b[39;00m {\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m}:\n\u001b[0;32m 276\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[0;32m 277\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIPython won\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt let you open fd=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mfile\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m by default \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 278\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mas it is likely to crash IPython. If you know what you are doing, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 279\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124myou can use builtins\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m open.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 280\u001b[0m )\n\u001b[1;32m--> 282\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m io_open(file, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
"\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'C:\\\\Users\\\\yozhan\\\\Downloads\\\\Archive\\\\Dogecoin copy\\\\Dogecoinsubmission4.csv'"
]
}
],
"source": [
"ts_list = []\n",
"with open(r\"C:\\Users\\yozhan\\Downloads\\Archive\\Dogecoin copy\\Dogecoinsubmission4.csv\", \"r\", encoding=\"utf-8\") as infile:\n",
" csv_reader = csv.reader(infile, delimiter=' ', quotechar='|')\n",
" for row in csv_reader:\n",
" ts = row[1]\n",
" ts_list.append(ts)"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "37792ef7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n"
]
},
{
"ename": "ValueError",
"evalue": "min() arg is an empty sequence",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[41], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;28mlen\u001b[39m(ts_list))\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(datetime\u001b[38;5;241m.\u001b[39mfromtimestamp(\u001b[38;5;28mfloat\u001b[39m(\u001b[38;5;28;43mmin\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mts_list\u001b[49m\u001b[43m)\u001b[49m)))\n\u001b[0;32m 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(datetime\u001b[38;5;241m.\u001b[39mfromtimestamp(\u001b[38;5;28mfloat\u001b[39m(\u001b[38;5;28mmax\u001b[39m(ts_list))))\n",
"\u001b[1;31mValueError\u001b[0m: min() arg is an empty sequence"
]
}
],
"source": [
"print(len(ts_list))\n",
"print(datetime.fromtimestamp(float(min(ts_list))))\n",
"print(datetime.fromtimestamp(float(max(ts_list))))"
]
}
],
"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.10.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|