{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "from datetime import datetime" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "\n", "max_efficiency = pd.read_csv('Bitcoin max updated.csv') # rows are Date,Hardware (TH/J),Hardware with Archaicity (TH/J)\n", "max_efficiency" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "\n", "\n", "# loop through rows\n", "for i in range(len(max_efficiency)):\n", " # get the date\n", " date = max_efficiency.iloc[i]['Date']\n", "\n", " date_format = \"%Y-%m-%d\"\n", " updates = [\n", " (\"2012-11-19\", 0.00025), # BFL\n", " (\"2013-01-16\", \t1250/1000000), # jalapeno\n", " (\"2013-06-22\", 0.0004), # KNC\n", " (\"2013-09-18\", \t0.000909), #hashfast\n", " (\"2013-11-26\", \t0.001429), # KNC neptune\n", " (\"2017-11-01\", \t0.01021), # antminer s9\n", " (\"2018-09-20\", \t15384/1000000), # microbt whatsminer m10 https://bitcointalk.org/index.php?topic=5033998.0\n", " (\"2018-08-07\", \t12121/1000000), # innosilicon t2 turbo\n", " ]\n", " for (update_date, update_value) in updates:\n", " if datetime.strptime(date, date_format) > datetime.strptime(update_date, date_format):\n", " max_efficiency.loc[i, 'Hardware (TH/J)'] = max(max_efficiency.loc[i, 'Hardware (TH/J)'], update_value)\n", "\n", "max_efficiency.to_csv('pmaxv1.csv', index=False)" ] } ], "metadata": { "kernelspec": { "display_name": "py310", "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.13" } }, "nbformat": 4, "nbformat_minor": 2 }