Sydney Stock Exchange – calendar view

This notebook helps you see the number of stock and share sheets in the bound volumes from the Sydney Stock Exchange for each day from 1901 to 1950. You can pick out major changes such as when the number of sheets per day changed, and when Saturday trading finished. For example, if you look at July 1934 you'll see the number of sheets produced per day changed from 5 to 6, and in April 1937 that increased again to 9. You'll also pick out official holidays and other days on which trading was suspended. Look for the ends of the wars! Hover over each day for more information.

However, the bound volumes are not always complete. You'll notice some days have fewer sheets than expected or none at all. In 1947, for example, there are no pages from September. Where there are no pages, I've searched Trove for evidence that trading was suspended and added a note when I've found something. In using these records it's important to be aware of the gaps.

In [13]:
import pandas as pd
from IPython.display import display, HTML
import altair as alt
from math import ceil
In [14]:
def week_of_month(dt):
    '''
    Returns the week of the month for the specified date.
    From: https://stackoverflow.com/a/16804556
    '''
    first_day = dt.replace(day=1)
    dom = dt.day
    adjusted_dom = dom + first_day.weekday()
    return int(ceil(adjusted_dom/7.0))

# Get the list of dates
df = pd.read_csv('complete_date_list.csv', parse_dates=['date'])
df.loc[:, 'week'] = df.loc[:, 'date'].apply(week_of_month)
# Make empty reasons an empty string so they look better in tooltips
df['reason'].fillna(value='', inplace=True)
In [17]:
def make_year_chart(df, year):
    # Filter df to specified year
    df_year = df.loc[(df['date'] >= f'{year}-01-01') & (df['date'] <= f'{year}-12-31')]
    chart = alt.Chart(df_year).mark_rect(stroke='white').encode(
        # Days of the week. Have to set order specifically to put Sunday at the end of the week
        x=alt.X('date:O', timeUnit='day', title=None, sort=['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']),
        # The rows are weeks
        y=alt.Y('week:O', title=None, axis=alt.Axis(ticks=False, labels=False)),
        # Facet by month
        facet=alt.Facet('month(date):T', title='', columns=4, header=alt.Header(format='%B', labelFontWeight=alt.FontWeight('bold'))),
        # Colours indicate the number of pages
        color=alt.Color('pages:Q', scale=alt.Scale(scheme='yelloworangebrown', domain=[0,10]), legend=alt.Legend(title='Number of pages')),
        tooltip=[alt.Tooltip('date:T', format='%a, %e %b %Y'), 'pages:Q', 'expected:Q', 'reason']
    ).resolve_scale(x='independent')
    return chart
In [18]:
for year in range(1901, 1951):
    display(HTML(f'<h2>{year}</h2>'))
    display(make_year_chart(df, year))

1901

1902

1903

1904

1905

1906

1907

1908

1909

1910

1911

1912

1913

1914

1915

1916

1917

1918

1919

1920

1921

1922

1923

1924

1925