Compare commits
3 Commits
df535bdb9a
...
2888c521cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2888c521cc | ||
|
|
7b279dbc61 | ||
|
|
a410c3dcd8 |
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -42,7 +42,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -67,7 +67,7 @@
|
||||
" return rides.assign(\n",
|
||||
" mph=round(mi / hr, 2),\n",
|
||||
" vam=round(ft / hr / 3.28084),\n",
|
||||
" fpmi=round(ft / mi),\n",
|
||||
" ftpmi=round(ft / mi),\n",
|
||||
" pct=round(ft / mi * 100 / 5280, 2),\n",
|
||||
" kms=round(mi * 1.609, 2),\n",
|
||||
" meters=round(ft * 0.3048))\n",
|
||||
@ -80,17 +80,50 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"execution_count": 9,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"rides = parse_rides(open('bikerides.tsv'))\n",
|
||||
"from datetime import datetime, timedelta\n",
|
||||
"date_format = \"%b %d, %Y, %I:%M:%S %p\"\n",
|
||||
"\n",
|
||||
"yearly = parse_rides(open('bikeyears.tsv')).drop(columns='date')\n",
|
||||
"rides = parse_rides('bikerides.tsv')\n",
|
||||
"\n",
|
||||
"yearly = parse_rides('bikeyears.tsv').drop(columns='date')\n",
|
||||
"\n",
|
||||
"daily = yearly.copy()\n",
|
||||
"for name in 'hours miles feet kms meters'.split():\n",
|
||||
" daily[name] = round(daily[name].map(lambda x: x / (6 * 50)), 1)"
|
||||
"days = 300\n",
|
||||
"for name in 'hours miles feet rides kms meters'.split():\n",
|
||||
" daily[name] = round(daily[name].map(lambda x: x / days), 1)\n",
|
||||
"\n",
|
||||
"df = pd.read_table('activities.csv', delimiter=',')\n",
|
||||
"pd.options.mode.copy_on_write = True\n",
|
||||
"fields = ['Activity Date', 'Activity Name', 'Moving Time', 'Distance', 'Elevation Gain', 'Elapsed Time']\n",
|
||||
"df2 = df[fields]\n",
|
||||
"\n",
|
||||
"def to_clock(seconds: int) -> str:\n",
|
||||
" rest, s = divmod(round(seconds), 60)\n",
|
||||
" h, m = divmod(rest, 60)\n",
|
||||
" return f'{h:02d}:{m:02d}:{s:02d}'\n",
|
||||
"\n",
|
||||
"to_clock(121 + 60*60*7)\n",
|
||||
"\n",
|
||||
"def compute_end_time(row, timezone=-7):\n",
|
||||
" start = datetime.strptime(row['Activity Date'], date_format)\n",
|
||||
" delta = timedelta(seconds=row['Moving Time'], hours=timezone)\n",
|
||||
" return (start + delta).strftime(date_format)\n",
|
||||
"\n",
|
||||
"def add_timezone(row, timezone=-7):\n",
|
||||
" start = datetime.strptime(row['Activity Date'], date_format)\n",
|
||||
" delta = timedelta(hours=timezone)\n",
|
||||
" return (start + delta).strftime(date_format)\n",
|
||||
" \n",
|
||||
"df2['End Time'] = df2.apply(compute_end_time, axis=1)\n",
|
||||
"df2['Activity Date'] = df2.apply(add_timezone, axis=1)\n",
|
||||
"\n",
|
||||
"df2 = df2.drop('Elapsed Time', axis=1)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -110,7 +143,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -127,7 +160,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -146,13 +179,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 25,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"segments = parse_segments(open('bikesegments.csv'))\n",
|
||||
"\n",
|
||||
"tiles = drop_index(pd.DataFrame(columns='date square cluster total comment'.split(), data=[\n",
|
||||
" ('01/01/2026', 14, 1446, 3634, 'Start of 2026'),\n",
|
||||
" ('08/29/2025', 14, 1424, 3594, 'Mt Madonna!15631499842'),\n",
|
||||
" ('01/01/2025', 14, 1395, 3520, 'Start of 2025'),\n",
|
||||
" ('09/21/2024', 14, 1394, 3496, 'Michael J. Fox ride in Sonoma!12470434052'),\n",
|
||||
" ('04/28/2024', 14, 1275, 3382, 'Livermore!11287081291'),\n",
|
||||
@ -178,7 +213,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 14,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -218,18 +253,19 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Wandrer Places "
|
||||
"# Wandrer Places (No Longer Used)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": 18,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def mapl(f, *values): return list(map(f, *values))\n",
|
||||
"\n",
|
||||
"places = drop_index(pd.read_table(open('bikeplaceshort.csv'), sep=',', comment='#'))\n",
|
||||
"places = None\n",
|
||||
"#places = drop_index(pd.read_table(open('bikeplaceshort.csv'), sep=',', comment='#'))\n",
|
||||
"\n",
|
||||
"def wandrer(places=places, by=['pct', 'name'], ascending=[False, True], county=None):\n",
|
||||
" \"All those who wander are not lost.\" # Also try by=['county', 'pct']\n",
|
||||
@ -276,7 +312,9 @@
|
||||
" else f'{round(x):,d}' if x > 10 \n",
|
||||
" else f'{x:.1f}')\n",
|
||||
"\n",
|
||||
"other_places = places[~places.county.isin(['---', 'SMC', 'SCC', 'SFC', 'ALA'])]"
|
||||
"#other_places = places[~places.county.isin(['---', 'SMC', 'SCC', 'SFC', 'ALA'])]\n",
|
||||
"\n",
|
||||
"# wandrer(county='SMC') # Also, SCC, ALA, SFC, '---'"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -288,21 +326,252 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 33,
|
||||
"execution_count": 42,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<style scoped>\n",
|
||||
" .dataframe tbody tr th:only-of-type {\n",
|
||||
" vertical-align: middle;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe tbody tr th {\n",
|
||||
" vertical-align: top;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe thead th {\n",
|
||||
" text-align: right;\n",
|
||||
" }\n",
|
||||
"</style>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>Name</th>\n",
|
||||
" <th>SMC %</th>\n",
|
||||
" <th>SCC %</th>\n",
|
||||
" <th>SMC Rank</th>\n",
|
||||
" <th>SCC Rank</th>\n",
|
||||
" <th>SMC miles</th>\n",
|
||||
" <th>SCC miles</th>\n",
|
||||
" <th>Total miles</th>\n",
|
||||
" <th>Mean %</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Peter Norvig</td>\n",
|
||||
" <td>78.80</td>\n",
|
||||
" <td>38.83</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>2251</td>\n",
|
||||
" <td>2978</td>\n",
|
||||
" <td>5229</td>\n",
|
||||
" <td>58.81</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Megan Gardner</td>\n",
|
||||
" <td>100.00</td>\n",
|
||||
" <td>30.26</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>11</td>\n",
|
||||
" <td>2856</td>\n",
|
||||
" <td>2321</td>\n",
|
||||
" <td>5177</td>\n",
|
||||
" <td>65.13</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Chris Okeefe</td>\n",
|
||||
" <td>32.95</td>\n",
|
||||
" <td>51.32</td>\n",
|
||||
" <td>18</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>941</td>\n",
|
||||
" <td>3936</td>\n",
|
||||
" <td>4877</td>\n",
|
||||
" <td>42.14</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Brian Feinberg</td>\n",
|
||||
" <td>38.10</td>\n",
|
||||
" <td>48.22</td>\n",
|
||||
" <td>14</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>1088</td>\n",
|
||||
" <td>3698</td>\n",
|
||||
" <td>4786</td>\n",
|
||||
" <td>43.16</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Barry Mann</td>\n",
|
||||
" <td>78.06</td>\n",
|
||||
" <td>32.33</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>12</td>\n",
|
||||
" <td>2230</td>\n",
|
||||
" <td>2479</td>\n",
|
||||
" <td>4709</td>\n",
|
||||
" <td>55.20</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Jason Molenda</td>\n",
|
||||
" <td>7.60</td>\n",
|
||||
" <td>56.16</td>\n",
|
||||
" <td>-</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>217</td>\n",
|
||||
" <td>4307</td>\n",
|
||||
" <td>4524</td>\n",
|
||||
" <td>31.88</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Jim Brooks</td>\n",
|
||||
" <td>6.17</td>\n",
|
||||
" <td>53.52</td>\n",
|
||||
" <td>-</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>176</td>\n",
|
||||
" <td>4104</td>\n",
|
||||
" <td>4280</td>\n",
|
||||
" <td>29.85</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>David Deggeller</td>\n",
|
||||
" <td>28.95</td>\n",
|
||||
" <td>39.76</td>\n",
|
||||
" <td>25</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>827</td>\n",
|
||||
" <td>3049</td>\n",
|
||||
" <td>3876</td>\n",
|
||||
" <td>34.35</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>François-Xavier (FX) Bucher</td>\n",
|
||||
" <td>14.25</td>\n",
|
||||
" <td>45.01</td>\n",
|
||||
" <td>-</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>407</td>\n",
|
||||
" <td>3452</td>\n",
|
||||
" <td>3859</td>\n",
|
||||
" <td>29.63</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Greogory P. Smith</td>\n",
|
||||
" <td>53.01</td>\n",
|
||||
" <td>23.47</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>-</td>\n",
|
||||
" <td>1514</td>\n",
|
||||
" <td>1800</td>\n",
|
||||
" <td>3314</td>\n",
|
||||
" <td>38.24</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Matthew Ring</td>\n",
|
||||
" <td>86.21</td>\n",
|
||||
" <td>4.94</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>-</td>\n",
|
||||
" <td>2462</td>\n",
|
||||
" <td>379</td>\n",
|
||||
" <td>2841</td>\n",
|
||||
" <td>45.57</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Catherine Kircos</td>\n",
|
||||
" <td>54.52</td>\n",
|
||||
" <td>16.42</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>-</td>\n",
|
||||
" <td>1557</td>\n",
|
||||
" <td>1259</td>\n",
|
||||
" <td>2816</td>\n",
|
||||
" <td>35.47</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <td>Elliot Hoff</td>\n",
|
||||
" <td>52.89</td>\n",
|
||||
" <td>8.34</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>-</td>\n",
|
||||
" <td>1511</td>\n",
|
||||
" <td>640</td>\n",
|
||||
" <td>2151</td>\n",
|
||||
" <td>30.62</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" Name SMC % SCC % SMC Rank SCC Rank SMC miles \\\n",
|
||||
" Peter Norvig 78.80 38.83 2 5 2251 \n",
|
||||
" Megan Gardner 100.00 30.26 1 11 2856 \n",
|
||||
" Chris Okeefe 32.95 51.32 18 2 941 \n",
|
||||
" Brian Feinberg 38.10 48.22 14 4 1088 \n",
|
||||
" Barry Mann 78.06 32.33 3 12 2230 \n",
|
||||
" Jason Molenda 7.60 56.16 - 3 217 \n",
|
||||
" Jim Brooks 6.17 53.52 - 1 176 \n",
|
||||
" David Deggeller 28.95 39.76 25 6 827 \n",
|
||||
" François-Xavier (FX) Bucher 14.25 45.01 - 7 407 \n",
|
||||
" Greogory P. Smith 53.01 23.47 7 - 1514 \n",
|
||||
" Matthew Ring 86.21 4.94 4 - 2462 \n",
|
||||
" Catherine Kircos 54.52 16.42 6 - 1557 \n",
|
||||
" Elliot Hoff 52.89 8.34 5 - 1511 \n",
|
||||
"\n",
|
||||
" SCC miles Total miles Mean % \n",
|
||||
" 2978 5229 58.81 \n",
|
||||
" 2321 5177 65.13 \n",
|
||||
" 3936 4877 42.14 \n",
|
||||
" 3698 4786 43.16 \n",
|
||||
" 2479 4709 55.20 \n",
|
||||
" 4307 4524 31.88 \n",
|
||||
" 4104 4280 29.85 \n",
|
||||
" 3049 3876 34.35 \n",
|
||||
" 3452 3859 29.63 \n",
|
||||
" 1800 3314 38.24 \n",
|
||||
" 379 2841 45.57 \n",
|
||||
" 1259 2816 35.47 \n",
|
||||
" 640 2151 30.62 "
|
||||
]
|
||||
},
|
||||
"execution_count": 42,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"def make_leaders(raw_data):\n",
|
||||
" \"\"\"Make a dataframe of leaders in two counties.\"\"\"\n",
|
||||
" data = [(name, SMp, SCp, *county_miles(SMp, SCp), round((SMp * SCp) ** 0.5, 2), round((SMp + SCp) / 2, 2), initials(name))\n",
|
||||
" for (name, SMp, SCp) in raw_data]\n",
|
||||
" data = [(name, SMp, SCp, SMrank, SCrank, *county_miles(SMp, SCp), round((SMp + SCp) / 2, 2))\n",
|
||||
" for (name, SMp, SMrank, SCp, SCrank) in raw_data]\n",
|
||||
" leaders = pd.DataFrame(data, columns=[\n",
|
||||
" 'Name', 'SMC %', 'SCC %', 'SMC miles', 'SCC miles', 'Total miles', 'GeoMean %', 'Mean %', 'Initials'])\n",
|
||||
" 'Name', 'SMC %', 'SCC %', 'SMC Rank', 'SCC Rank', 'SMC miles', 'SCC miles', 'Total miles', 'Mean %']\n",
|
||||
" ).sort_values('Mean %', ascending=False)\n",
|
||||
" return drop_index(leaders)\n",
|
||||
"\n",
|
||||
"def county_miles(SMp, SCp) -> list:\n",
|
||||
" SMmiles = round(2827.3 * SMp / 100)\n",
|
||||
" SCmiles = round(7688.7 * SCp / 100)\n",
|
||||
" SMmiles = round(2856.3 * SMp / 100)\n",
|
||||
" SCmiles = round(7668.7 * SCp / 100)\n",
|
||||
" return [SMmiles, SCmiles, SMmiles + SCmiles] \n",
|
||||
"\n",
|
||||
"def initials(name: str) -> str:\n",
|
||||
@ -310,10 +579,12 @@
|
||||
" return name[0] + name.split()[-1][0]\n",
|
||||
"\n",
|
||||
"def plot_leaders(leaders, by='Mean %'):\n",
|
||||
" \"\"\"Plot of pareto Frontier\"\"\" ## NOT CURRENTLY USED\n",
|
||||
" leaders = leaders.sort_values(by=by, ascending=False)\n",
|
||||
" ax = leaders.plot('SMC %', 'SCC %', kind='scatter', marker='D')\n",
|
||||
" front = sorted((x, y) for i, (_, _, x, y, *_) in leaders.iterrows())\n",
|
||||
" \"ax.axis('square')\"; grid()\n",
|
||||
" #ax.axis('square'); \n",
|
||||
" grid()\n",
|
||||
" ax.set_xlabel('San Mateo County %')\n",
|
||||
" ax.set_ylabel('Santa Clara County %')\n",
|
||||
" for i, (name, x, y, *_) in leaders.iterrows():\n",
|
||||
@ -321,18 +592,21 @@
|
||||
" return leaders\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"leaders = make_leaders([ # Data as of Mar 24, 2025 (Name, Initials, SMC, SCC)\n",
|
||||
" ('Megan Gardner', 99.94, 25.21),\n",
|
||||
" ('Matthew Ring', 83.16, 2.48),\n",
|
||||
" ('Peter Norvig', 78.80, 38.83),\n",
|
||||
" ('Barry Mann', 78.27, 31.09), \n",
|
||||
" ('Catherine Kircos', 54.47, 16.04),\n",
|
||||
" ('Elliot Hoff', 52.89, 6.13),\n",
|
||||
" ('Greogory P. Smith', 51.37, 23.27),\n",
|
||||
" ('Brian Feinberg', 36.76, 48.22),\n",
|
||||
" ('Chris Okeefe', 32.17, 48.30),\n",
|
||||
" ('Jason Molenda', 7.60, 56.15),\n",
|
||||
" ('Jim Brooks', 6.17, 53.51),\n",
|
||||
"leaders = make_leaders([ # Data as of Dec 31 2025 \n",
|
||||
" #(Name, SMC, SMC Rank, SCC, SCC Rank)\n",
|
||||
" ('Megan Gardner', 100.00, 1, 30.26, 11),\n",
|
||||
" ('Matthew Ring', 86.21, 4, 4.94, '-'),\n",
|
||||
" ('Peter Norvig', 78.80, 2, 38.83, 5),\n",
|
||||
" ('Barry Mann', 78.06, 3, 32.33, 12), \n",
|
||||
" ('Catherine Kircos', 54.52, 6, 16.42, '-'),\n",
|
||||
" ('Elliot Hoff', 52.89, 5, 8.34, '-'),\n",
|
||||
" ('Greogory P. Smith', 53.01, 7, 23.47, '-'),\n",
|
||||
" ('Brian Feinberg', 38.10, 14, 48.22, 4),\n",
|
||||
" ('Chris Okeefe', 32.95, 18, 51.32, 2),\n",
|
||||
" ('Jason Molenda', 7.60, '-', 56.16, 3),\n",
|
||||
" ('Jim Brooks', 6.17, '-', 53.52, 1),\n",
|
||||
" ('David Deggeller', 28.95, 25, 39.76, 6),\n",
|
||||
" ('François-Xavier (FX) Bucher', 14.25, '-', 45.01, 7)\n",
|
||||
" ])"
|
||||
]
|
||||
},
|
||||
@ -345,9 +619,20 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": 20,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"(106, 70)"
|
||||
]
|
||||
},
|
||||
"execution_count": 20,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"def Ed_number(rides, units) -> int:\n",
|
||||
" \"\"\"Eddington number: The maximum integer e such that you have bicycled \n",
|
||||
@ -367,8 +652,8 @@
|
||||
" df = pd.DataFrame(data, columns=['kms', 'kms gap', 'miles', 'miles gap'])\n",
|
||||
" return drop_index(df)\n",
|
||||
"\n",
|
||||
"def Ed_progress(rides, years=range(2024, 2013, -1)) -> pd.DataFrame:\n",
|
||||
" \"\"\"A table of Eddington numbers by year, and a plot.\"\"\"\n",
|
||||
"def Ed_progress(rides, years=range(2025, 2013, -1)) -> pd.DataFrame:\n",
|
||||
" \"\"\"A table of Eddington numbers by year.\"\"\"\n",
|
||||
" def Ed(year, unit): return Ed_number(rides[rides['year'] <= year], unit)\n",
|
||||
" data = [(y, Ed(y, 'kms'), Ed(y, 'miles')) for y in years]\n",
|
||||
" df = pd.DataFrame(data, columns=['year', 'Ed_km', 'Ed_mi'])\n",
|
||||
@ -377,7 +662,79 @@
|
||||
"def count_rides(rides, unit='kms', distance=100) -> int:\n",
|
||||
" return count(rides[unit] > distance)\n",
|
||||
"\n",
|
||||
"count = sum"
|
||||
"count = sum\n",
|
||||
"\n",
|
||||
"Ed_number(rides, 'kms'), Ed_number(rides, 'miles')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"## NEW\n",
|
||||
"'''\n",
|
||||
"def eddington_distances(rides, lowest=26, threshold=70) -> List[float]:\n",
|
||||
" @lru_cache(None)\n",
|
||||
" def best(i) -> List[float]:\n",
|
||||
" \"\"\"Among all ways to merge rides starting at position i,\n",
|
||||
" the way that maximizes the rides over threshold.\"\"\"\n",
|
||||
" ms := merges(i)\n",
|
||||
" if i >= len(rides):\n",
|
||||
" return []\n",
|
||||
" elif not ms:\n",
|
||||
" return best(i + 1)\n",
|
||||
" else:\n",
|
||||
" ms = merges(i)\n",
|
||||
" if not ms:\n",
|
||||
" (n, j) = max((d > threshold) + above(j + 1, threshold)\n",
|
||||
" for (d, j) in merges(i))\n",
|
||||
" results.append(distance)\n",
|
||||
" return n\n",
|
||||
" best(j)\n",
|
||||
" best(0)\n",
|
||||
" return best(0)\n",
|
||||
"''' \n",
|
||||
" \n",
|
||||
"None"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def Ed_plot(rides) -> None:\n",
|
||||
" distances1 = sorted(rides['miles'], reverse=True)\n",
|
||||
" distances2 = sorted(rides['kms'], reverse=True)\n",
|
||||
" Ys = range(60, 110)\n",
|
||||
" for label in ('miles', 'kms'):\n",
|
||||
" plt.plot(Ys, [count(rides[label] >= y) - y for y in Ys], 'o:', label='Distance in ' + label)\n",
|
||||
" plt.xlabel('Distance'); plt.ylabel('Eddington Gap')\n",
|
||||
" plt.plot([min(Ys), max(Ys)], [0, 0], 'r-', label='Zero Gap')\n",
|
||||
" plt.grid(); plt.legend()\n",
|
||||
"\n",
|
||||
"#Ed_plot(rides)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def Ed_plot2(rides) -> None:\n",
|
||||
" distances1 = sorted(rides['miles'], reverse=True)\n",
|
||||
" distances2 = sorted(rides['kms'], reverse=True)\n",
|
||||
" plt.plot(range(1, len(distances1) + 1), distances1, '.-', label='rides')\n",
|
||||
" plt.plot([0, 100], [0, 100], ':', label='miles')\n",
|
||||
" c = 0.621371 * 200\n",
|
||||
" plt.plot([0, 200], [0, c], ':', label='kms')\n",
|
||||
" plt.grid(); plt.legend()\n",
|
||||
"\n",
|
||||
"#Ed_plot2(rides)"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -397,7 +754,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.13.1"
|
||||
"version": "3.13.3"
|
||||
},
|
||||
"toc-autonumbering": true
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
6453
ipynb/activities.csv
Normal file
6453
ipynb/activities.csv
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,19 @@
|
||||
date title hours miles feet
|
||||
#
|
||||
# 2025
|
||||
#
|
||||
#
|
||||
Fri, 12/19/2025 Livermore, Pleasanton 4:34:46 71.12 1,125
|
||||
Tue, 12/16/2025 Pleasanton 3:49:58 73.65 971
|
||||
Sat, 12/13/2025 Afternoon Ride 5:07:55 76.09 2,011
|
||||
Fri, 12/5/2025 Niles and 90% of Newark. Again. 5:08:45 74.25 551
|
||||
Sun, 11/9/2025 Moss Beach 6:06:59 77.64 2,477
|
||||
Sat, 8/16/2025 Sheeps Camp / Water Dog + HMB 6:28:08 76.16 3,212
|
||||
Wed, 7/23/2025 Sunnyvale to 86% + 90% 4:48:18 70.14 834
|
||||
Fri, 7/4/2025 Rosie the Riveter + etc 5:32:38 72.62 46
|
||||
Sun, 6/15/2025 Aqueduct / Del Puerto Canyon / Mines 6:18:12 82.94 1,430
|
||||
Tue, 6/3/2025 Page Mill + Dumbarton Loop 5:13:39 67.30 2,087
|
||||
Sun, 5/18/2025 South SF 90% + 85% 5:51:35 66.17 4,260
|
||||
Sat, 4/5/2025 Megan 100% SMC: Wandrer group ride + Afternoon 5:41:29 68.77 5,289
|
||||
Fri, 3/21/2025 Saratoga 5:51:36 71.96 2,241
|
||||
Fri, 2/28/2025 Colma etc 6:26:23 74.23 5,607
|
||||
#
|
||||
|
||||
|
Can't render this file because it has a wrong number of fields in line 4.
|
@ -1,92 +1,63 @@
|
||||
Alma Mountain Charlie, 3.12, 875, 31:49
|
||||
Alpine Westridge, 0.76, 99, 3:26, 3:29, 3:43
|
||||
Alpine last kicker, 0.39, 114, 3:11, 3:36, 5:19
|
||||
Alpine Portola to top Joaquin, 3.52, 801, 33:58, 34:36
|
||||
Alpine Willowbrook to Joaquin, 2.27, 461, 16:46, 17:27, 19:08
|
||||
Arastradero, 1.19, 193, 6:41, 7:49, 7:55
|
||||
Arastradero last two bumps, 0.32, 95, 3:10
|
||||
Atherton Ave Stinger, 0.23, 88, 2:24
|
||||
Cabrillo Hmy S, 0.46, 153, 4:31
|
||||
Camaritas climb, 0.10, 48, 0:51
|
||||
Canada to College, 1.37, 119, 5:55, 6:23, 6:35
|
||||
Canon, 0.90, 295, 11:04, 11:55
|
||||
Canon to No Cycling, 0.75, 198, 5:14, 5:41
|
||||
Cemetery Sprint, 0.08, 33, 0:33
|
||||
Chalk Hill SB sprint, 0.17, 21, 2:11
|
||||
Coe Second Switchback to flat, 1.00, 483, 13:27
|
||||
Communications Hill Climb, 0.20, 103, 2:32
|
||||
Davenport Kicker, 0.24, 74, 1:17
|
||||
DNA hill, 0.28, 83, 2:08
|
||||
Dunne Steeps, 0.42, 204, 5:11
|
||||
Entrance Way Hill Repeats, 0.10, 76, 1:25
|
||||
Faught Turn, 0.22, 60, 1:16
|
||||
Foothill Homestead, 1.22, 126, 5:31, 6:36, 6:53
|
||||
Green Valley Roller of Death, 0.17, 84, 2:08
|
||||
green valley kicker, 0.29, 178, 4:33
|
||||
Haskins, 1.51, 566, 17:47, 18:43, 18:47
|
||||
Highway 1 Cascanoa to Cascade, 1.61, 89, 5:20
|
||||
Highway 9, 0.56, 260, 8:33
|
||||
Highway 9 Mantalvo, 0.45, 35, 1:36, 1:48, 1:53
|
||||
Huddart, 0.92, 385, 10:15, 11:18, 12:55
|
||||
Invernes to Firecrest Climb, 0.28, 143, 2:35
|
||||
Joaquin, 0.33, 254, 5:22, 6:00, 7:27
|
||||
Kaboom Portola Rd, 0.67, 102, 3:14, 3:26, 3:33
|
||||
Kings half way, 2.89, 820, 27:26, 29:45, 32:43
|
||||
Kings to Skeggs, 1.10, 273, 9:07, 10:39, 10:53
|
||||
Kings Greer to Skyline, 3.92, 1536, 46:53, 48:36, 54:25
|
||||
Kings Mountain Rd Climb, 0.56, 296, 8:23
|
||||
Kings Mountain final sprint, 0.31, 135, 2:26
|
||||
Klamath Dr., 0.12, 77, 0:55
|
||||
Laning Bump, 0.24, 94, 2:00
|
||||
Limantour Spit, 0.47, 303, 5:19
|
||||
Limantour steepest, 0.20, 159, 5:41
|
||||
Lobitas Creek, 0.96, 430, 12:15
|
||||
Lower Redwood Gulch, 1.03, 474, 13:00
|
||||
Mapache, 0.24, 111, 2:52, 2:55
|
||||
Mt Eden climb, 1.02, 272, 8:32, 9:43, 11:59
|
||||
Mt Eden to Archery, 0.54, 180, 5:19, 5:39, 6:12
|
||||
Official Bike Hut Classic 8.33, 1908, 1:08:50
|
||||
Old La Honda (Bridge to Stop), 3.33, 1255, 28:42, 30:32, 36:04
|
||||
Old La Honda Mile 1, 0.99, 370, 8:02, 9:36, 9:51
|
||||
Paloma Climb, 0.14, 82, 1:26
|
||||
Page Mill to Moody, 0.21, 112, 2:50, 2:55
|
||||
Page Mill to Ventana, 0.47, 196, 4:54, 5:32, 6:05
|
||||
PCH Pescadero to Bean Hollow, 2.77, 51, 8:07
|
||||
Peach Hill, 0.60, 248, 7:30, 7:50
|
||||
Pomponio Creek, 0.38, 122, 2:47, 2:55, 3:16
|
||||
PV: Sand Hill SLAC to Rosewood, 0.33, 75, 1:41, 1:43, 1:48
|
||||
Red Hill KOM, 0.34, 161, 4:15
|
||||
Redwood Gulch hits, 0.18, 151, 3:36
|
||||
Redwood Gulch wall, 0.43, 258, 6:39
|
||||
Sand Gill Sharon-top, 0.85, 136, 4:03, 4:16, 4:24
|
||||
Sand Hill 280 to horse, 0.49, 95, 2:34, 2:44, 2:51
|
||||
Sand Hill Alpine to 280, 1.67, 180, 7:02, 7:39, 8:02
|
||||
Sharon Park steep part, 0.21, 86, 1:57
|
||||
Skyline Bump at OLH, 0.21, 63, 1:16, 1:40, 1:49
|
||||
Stair Step, 0.32, 175, 5:25
|
||||
Stage Rd, 1.01, 373, 11:36, 11:51, 12:28
|
||||
Stanford Ave, 0.63, 85, 3:14, 3:32, 3:49
|
||||
Stevens Country Park, 1.22, 112, 5:42, 5:58, 7:00
|
||||
Stirrup Wall, 0.17, 125, 3:47, 4:33
|
||||
Stirrup to Moon, 0.36, 159, 3:41, 6:07
|
||||
Summit Rd Climb, 0.60, 275, 8:00
|
||||
Tepa, 0.58, 248, 6:34, 7:14, 8:21
|
||||
The Boneyard, 1.48, 135, 6:05, 6:36, 7:00
|
||||
Top of Groton Rd heading west, 0.92, 291, 7:59
|
||||
Try not to fall back, 0.71, 410, 12:45
|
||||
Tunitas Knoll to Star, 1.55, 339, 12:28, 12:56, 13:51
|
||||
Tunitas flattens, 0.42, 166, 3:15, 3:16, 3:25
|
||||
Tunitas lower climb, 1.30, 421, 12:58, 13:34, 16:00
|
||||
Tunitas steep, 1.20, 599, 15:17, 16:15, 17:47
|
||||
Valparaiso steep, 0.18, 145, 2:26, 2:56, 3:18
|
||||
Vickrey Fruitvale, 0.99, 68, 3:41, 3:58, 4:26
|
||||
Watts (Sonoma), 1.20, 313, 8:37
|
||||
West Alpine switchback, 0.78, 322, 8:56, 10:52, 11:55
|
||||
West Alpine full, 7.38, 1887, 1:23:26
|
||||
Westridge, 0.68, 385, 8:28, 9:52, 10:18
|
||||
Westridge 3min, 0.37, 240, 4:41, 5:35, 6:31
|
||||
Westridge Hill 1, 0.51, 104, 3:19, 3:58
|
||||
Westridge Hill 2, 0.51, 166, 4:42, 5:10, 5:20
|
||||
Woghler Slap, 0.20, 47, 1:24
|
||||
Woodland Way, 0.13, 63, 1:36
|
||||
Woodside Climb, 1.71, 295, 8:05, 9:00, 9:35
|
||||
Alma Mt. Charlie, 3.12, 875, 31:49
|
||||
Alpine Westridge, 0.76, 99, 3:26, 3:29, 3:43
|
||||
Alpine last kicker, 0.39, 114, 3:11, 3:36, 5:19
|
||||
Arastradero, 1.19, 193, 6:41, 7:49, 7:55
|
||||
Bandera Dr, 0.19, 115, 2:53
|
||||
Bridge to Wild Rye, 0.06, 39, 0:37
|
||||
Bike Hut Classic (Tunitas), 8.33, 1908, 1:08:50, 1:20:57, 1:39:35
|
||||
Cabrillo Hmy S, 0.46, 153, 4:31
|
||||
Canada to College, 1.37, 119, 5:55, 6:23, 6:35
|
||||
Canon, 0.90, 295, 11:04, 11:55
|
||||
Canon to No Cycling, 0.75, 198, 5:14, 5:41
|
||||
Foothill Homestead, 1.22, 126, 5:31, 6:36, 6:53
|
||||
Haskins, 1.51, 566, 17:47, 18:43, 18:47
|
||||
Highway 9, 0.56, 260, 8:33
|
||||
Highway 9 Mantalvo, 0.45, 35, 1:36, 1:48, 1:53
|
||||
Huddart, 0.92, 385, 10:15, 11:18, 12:55
|
||||
Joaquin, 0.33, 253, 6:19, 7:27
|
||||
Kaboom Portola Rd, 0.67, 102, 3:14, 3:26, 3:33
|
||||
Kings half way, 2.89, 820, 27:26, 29:45, 32:43
|
||||
Kings to Skeggs, 1.10, 273, 9:07, 10:39, 10:53
|
||||
Kings via Greer and Huddart, 4.65, 1614, 45:59, 50:29, 55:09
|
||||
Limantour Spit, 0.47, 303, 5:19
|
||||
Limantour steepest, 0.20, 159, 5:41
|
||||
Lobitas Creek, 0.96, 430, 12:15, 12:07
|
||||
Lower Redwood Gulch, 1.03, 474, 13:00
|
||||
Mapache, 0.24, 111, 2:52, 2:55
|
||||
Mt Eden climb, 1.02, 272, 8:32, 9:43, 11:59
|
||||
Mt Eden to Archery, 0.54, 180, 5:19, 5:39, 6:12
|
||||
Old La Honda, 2.98, 1255, 28:49, 34:03, 36:44
|
||||
Old La Honda Mile 1, 0.99, 370, 8:02, 9:36, 9:51
|
||||
Page Mill to Moody, 0.21, 112, 2:50, 2:55
|
||||
Page Mill to Ventana, 0.47, 196, 4:54, 5:32, 6:05
|
||||
Page Mill Moody to Skyline, 11.45, 1302, 1:27:39, 1:32:28
|
||||
Peach Hill, 0.60, 248, 7:30, 7:50
|
||||
Pomponio Creek, 0.38, 122, 2:47, 2:55, 3:16
|
||||
Red Hill KOM, 0.34, 161, 4:15
|
||||
Redwood Gulch hits, 0.18, 151, 3:36
|
||||
Redwood Gulch wall, 0.43, 258, 6:39
|
||||
Sand Gill Sharon-top, 0.85, 136, 4:03, 4:16, 4:24
|
||||
Sand Hill 280 to horse, 0.49, 95, 2:34, 2:44, 2:51
|
||||
Sand Hill Alpine to 280, 1.67, 180, 7:02, 7:39, 8:02
|
||||
Short climb, 0.12, 67, 1:32
|
||||
Stair Step, 0.32, 175, 5:25
|
||||
Stanford Ave, 0.63, 85, 3:14, 3:32, 3:49
|
||||
Stevens Country Park, 1.22, 112, 5:42, 5:58, 7:00
|
||||
Stirrup Wall, 0.17, 125, 3:47, 4:33
|
||||
Stirrup to Moon, 0.36, 159, 3:41, 6:07
|
||||
Summit Rd Climb, 0.60, 275, 8:00
|
||||
Tepa, 0.58, 248, 6:34, 7:14, 8:21
|
||||
The Boneyard, 1.48, 135, 6:05, 6:36, 7:00
|
||||
Try not to fall back, 0.71, 410, 12:45
|
||||
Tunitas Knoll to Star, 1.55, 339, 12:28, 12:56, 13:51
|
||||
Tunitas flattens, 0.42, 166, 3:16, 3:25, 3:51
|
||||
Tunitas lower climb, 1.30, 421, 13:34, 16:00, 17:33
|
||||
Tunitas steep, 1.20, 599, 16:15, 17:47, 20:44
|
||||
Vickrey Fruitvale, 0.99, 68, 3:41, 3:58, 4:26
|
||||
West Alpine switchback, 0.78, 322, 8:56, 10:52, 11:55
|
||||
West Alpine Full, 7.38, 1887, 1:23:26, 1:32:30, 2:02:42
|
||||
Westridge, 0.68, 385, 8:28, 9:52, 10:18
|
||||
Westridge 3min, 0.37, 240, 4:41, 5:35, 6:31
|
||||
Westridge Hill 1, 0.51, 104, 3:19, 3:58
|
||||
Westridge Hill 2, 0.51, 166, 4:42, 5:10, 5:20
|
||||
Woodside Climb, 1.71, 295, 8:05, 9:00, 9:35
|
||||
|
@ -1,4 +1,5 @@
|
||||
date hours miles feet rides
|
||||
2025 508:21:00 6136 267667 390
|
||||
2024 511:41:00 6344 264838 393
|
||||
2023 541:41:00 6316 243100 372
|
||||
2022 532:56:00 6028 362323 349
|
||||
|
||||
|
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 1.7 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 931 KiB |
Loading…
x
Reference in New Issue
Block a user