skip to main content

@tonyfast s notebooks

site navigation
notebook summary
title
the bones of a clock
description
i was reading about dyscalculia at https://accessiblenumbers.com trying to understand how tables can be improved for folks with low numeracy. there was mention of time blindness which is a thing that can happen deep in interactive programming sessions. i thought it would be fun to start thinking about clocks and styling them and having fun. heres my sketch of a clock.
cells
4 total
3 code
state
executed in order
kernel
Python [conda env:p311] *
language
python
name
conda-env-p311-py
lines of code
80
outputs
3
table of contents
{"kernelspec": {"display_name": "Python [conda env:p311] *", "language": "python", "name": "conda-env-p311-py"}, "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.11.3"}, "widgets": {"application/vnd.jupyter.widget-state+json": {"state": {}, "version_major": 2, "version_minor": 0}}, "title": "the bones of a clock", "description": "i was reading about dyscalculia at https://accessiblenumbers.com trying to understand how tables can be improved for folks with low numeracy. there was mention of time blindness which is a thing that can happen deep in interactive programming sessions. i thought it would be fun to start thinking about clocks and styling them and having fun. heres my sketch of a clock."}
notebook toolbar
Activate
cell ordering
1

the bones of a clock

i was reading about dyscalculia at https://accessiblenumbers.com trying to understand how tables can be improved for folks with low numeracy. there was mention of time blindness which is a thing that can happen deep in interactive programming sessions. i thought it would be fun to start thinking about clocks and styling them and having fun. heres my sketch of a clock.

2
    time_stuff = operator.attrgetter(*(keys := "year month day hour minute second".split()))
    df = (
        pandas.to_datetime(["now"])
        .to_series()
        .apply(time_stuff)
        .apply(list)
        .series()
        .rename(columns=dict(enumerate(keys))).reset_index(drop=True)
        .set_index(Index(["value"]))
        .rename_axis(columns=["key"])
    ); df
1 outputs.
key year month day hour minute second
value 2024 4 18 22 57 28
3 1 outputs.
a clock
year month day hour minute second
2024 4 18 22 57 28
4
%%html
<style>
#A {
    thead {
        display: none;
    }
    tr, td {
        display: inline;
    }
    .hour {
        font-size: larger;
    }
    .year, .month {
        &::after {
            content: ".";
        }
    }
    .minute::before {
        content: ":"; 
    }
    .second {
        font-size: smaller;
        &::before {
            content: ":";
        }
    }
}
</style>
1 outputs.