{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"series = 'J2483'"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/vnd.plotly.v1+html": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/vnd.plotly.v1+html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import os\n",
"import pandas as pd\n",
"import series_details\n",
"import plotly.offline as py\n",
"py.init_notebook_mode()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv(os.path.join('data', '{}.csv'.format(series.replace('/', '-'))), parse_dates=['start_date', 'end_date'])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
"
National Archives of Australia: Series J2483
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Certificates Exempting from Dictation Test [CEDT] issued under \"The Immigration Restriction Acts 1901-1905\" and Regulations (and amending legislation), two number series
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Total items | 14,438 |
---|
Access status | |
---|
Open | 14,436 (99.99%) |
Not yet examined | 2 (0.01%) |
Number of items digitised | 14,436 (99.99%) |
---|
Number of pages digitised | 79,210 |
---|
Date of earliest content | 1903 |
---|
Date of latest content | 1956 |
---|
Download the complete CSV file
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"series_details.display_summary(series, df)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Content preview"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
" \n",
" \n",
" \n",
" | \n",
" identifier | \n",
" series | \n",
" control_symbol | \n",
" title | \n",
" contents_dates | \n",
" start_date | \n",
" end_date | \n",
" access_status | \n",
" location | \n",
" digitised_status | \n",
" digitised_pages | \n",
"
\n",
" \n",
" 0 | \n",
" 9086001 | \n",
" J2483 | \n",
" 16/16 | \n",
" Certificate Exempting from Dictation Test (CEDT) - Name: Yong Min - Nationality: Chinese - Birthplace: Canton - departed for China per TAIYUAN on 3 February 1909 | \n",
" 1909 - 1909 | \n",
" 1909-01-01 00:00:00 | \n",
" 1909-01-01 00:00:00 | \n",
" Open | \n",
" Brisbane | \n",
" True | \n",
" 2 | \n",
"
\n",
" 1 | \n",
" 9086002 | \n",
" J2483 | \n",
" 16/17 | \n",
" Certificate Exempting from Dictation Test (CEDT) - Name: Hong Chin - Nationality: Chinese - Birthplace: Canton - departed for China per TAIYUAN on 3 February 1909, returned to Cairns per EMPIRE on 16 June 1910 | \n",
" 1909 - 1910 | \n",
" 1909-01-01 00:00:00 | \n",
" 1910-01-01 00:00:00 | \n",
" Open | \n",
" Brisbane | \n",
" True | \n",
" 7 | \n",
"
\n",
" 2 | \n",
" 9086003 | \n",
" J2483 | \n",
" 16/18 | \n",
" Certificate Exempting from Dictation Test (CEDT) - Name: Ah Mun - Nationality: Chinese - Birthplace: Canton - departed for China per SS EASTERN on 11 June 1909, returned to Cairns per EASTERN on 22 October 1910 | \n",
" 1909 - 1910 | \n",
" 1909-01-01 00:00:00 | \n",
" 1910-01-01 00:00:00 | \n",
" Open | \n",
" Brisbane | \n",
" True | \n",
" 7 | \n",
"
\n",
" 3 | \n",
" 9086004 | \n",
" J2483 | \n",
" 16/21 | \n",
" Certificate Exempting from Dictation Test (CEDT) - Name: Tommy Hong - Nationality: Chinese - Birthplace: Canton - departed for China per EMPIRE on 17 February 1909, returned to Brisbane per EMPIRE on 6 November 1911 | \n",
" 1909 - 1911 | \n",
" 1909-01-01 00:00:00 | \n",
" 1911-01-01 00:00:00 | \n",
" Open | \n",
" Brisbane | \n",
" True | \n",
" 7 | \n",
"
\n",
" 4 | \n",
" 9086005 | \n",
" J2483 | \n",
" 16/22 | \n",
" Certificate Exempting from Dictation Test (CEDT) - Name: Duck Shan - Nationality: Chinese - Birthplace: Canton - departed for China per EMPIRE on 18 February 1909 | \n",
" 1909 - 1909 | \n",
" 1909-01-01 00:00:00 | \n",
" 1909-01-01 00:00:00 | \n",
" Open | \n",
" Brisbane | \n",
" True | \n",
" 2 | \n",
"
\n",
"
"
],
"text/plain": [
""
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Change the number_of_rows value to see more\n",
"number_of_rows = 5\n",
"\n",
"# Display dataframe \n",
"df[:number_of_rows].style.set_properties(['title'], **{'text-align': 'left'}).set_table_styles([dict(selector=\"th\", props=[(\"text-align\", \"center\")]),\n",
" dict(selector='.row_heading, .blank', props=[('display', 'none')])])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot content dates"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"data": [
{
"name": "Digitised",
"type": "bar",
"x": [
1903,
1904,
1905,
1906,
1907,
1908,
1909,
1910,
1911,
1912,
1913,
1914,
1915,
1916,
1917,
1918,
1919,
1920,
1921,
1922,
1923,
1924,
1925,
1926,
1927,
1928,
1929,
1930,
1931,
1932,
1933,
1934,
1935,
1936,
1937,
1938,
1939,
1940,
1941,
1942,
1943,
1944,
1945,
1946,
1947,
1948,
1949,
1950,
1951,
1952,
1953,
1954,
1955,
1956
],
"y": [
1,
1,
2,
6,
11,
325,
944,
1375,
1604,
1863,
1875,
1775,
1950,
2064,
1786,
1809,
1785,
1784,
1881,
1771,
1588,
1382,
1181,
1310,
1255,
1119,
926,
814,
648,
565,
497,
513,
522,
462,
421,
354,
248,
160,
108,
40,
36,
32,
32,
58,
77,
51,
30,
19,
9,
3,
2,
2,
3,
2
]
},
{
"name": "Not digitised",
"type": "bar",
"x": [
1947,
1948,
1949,
1950,
1951
],
"y": [
1,
1,
2,
1,
1
]
}
],
"layout": {
"barmode": "stack",
"title": "Content dates",
"xaxis": {
"title": "Year"
},
"yaxis": {
"title": "Number of items"
}
}
},
"text/html": [
""
],
"text/vnd.plotly.v1+html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = series_details.plot_dates(df)\n",
"py.iplot(fig, filename='series-dates-bar')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## View word frequencies"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# Combine all of the file titles into a single string\n",
"title_text = a = df['title'].str.lower().str.cat(sep=' ')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" \n",
" \n",
" | \n",
" word | \n",
" count | \n",
"
\n",
" \n",
" 14 | \n",
" per | \n",
" 24,566 | \n",
"
\n",
" 0 | \n",
" certificate | \n",
" 14,547 | \n",
"
\n",
" 4 | \n",
" cedt | \n",
" 14,452 | \n",
"
\n",
" 5 | \n",
" name | \n",
" 14,441 | \n",
"
\n",
" 1 | \n",
" exempting | \n",
" 14,441 | \n",
"
\n",
" 2 | \n",
" dictation | \n",
" 14,440 | \n",
"
\n",
" 3 | \n",
" test | \n",
" 14,440 | \n",
"
\n",
" 8 | \n",
" nationality | \n",
" 14,364 | \n",
"
\n",
" 10 | \n",
" birthplace | \n",
" 13,830 | \n",
"
\n",
" 12 | \n",
" departed | \n",
" 13,119 | \n",
"
\n",
" 9 | \n",
" chinese | \n",
" 11,753 | \n",
"
\n",
" 21 | \n",
" returned | \n",
" 11,529 | \n",
"
\n",
" 13 | \n",
" china | \n",
" 10,988 | \n",
"
\n",
" 11 | \n",
" canton | \n",
" 10,350 | \n",
"
\n",
" 22 | \n",
" cairns | \n",
" 4,777 | \n",
"
\n",
" 119 | \n",
" maru | \n",
" 4,649 | \n",
"
\n",
" 45 | \n",
" townsville | \n",
" 4,261 | \n",
"
\n",
" 36 | \n",
" brisbane | \n",
" 3,882 | \n",
"
\n",
" 30 | \n",
" eastern | \n",
" 3,139 | \n",
"
\n",
" 62 | \n",
" st | \n",
" 2,569 | \n",
"
\n",
" 46 | \n",
" december | \n",
" 2,563 | \n",
"
\n",
" 38 | \n",
" november | \n",
" 2,544 | \n",
"
\n",
" 63 | \n",
" albans | \n",
" 2,540 | \n",
"
\n",
" 27 | \n",
" ah | \n",
" 2,302 | \n",
"
\n",
" 33 | \n",
" october | \n",
" 2,280 | \n",
"
\n",
"
"
],
"text/plain": [
""
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"series_details.display_word_counts(title_text)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" \n",
" \n",
" | \n",
" ngram | \n",
" count | \n",
"
\n",
" \n",
" 0 | \n",
" exempting from | \n",
" 14,441 | \n",
"
\n",
" 1 | \n",
" certificate exempting | \n",
" 14,440 | \n",
"
\n",
" 2 | \n",
" from dictation | \n",
" 14,440 | \n",
"
\n",
" 3 | \n",
" dictation test | \n",
" 14,440 | \n",
"
\n",
" 4 | \n",
" test cedt | \n",
" 14,438 | \n",
"
\n",
" 5 | \n",
" cedt name | \n",
" 14,415 | \n",
"
\n",
" 6 | \n",
" departed for | \n",
" 13,078 | \n",
"
\n",
" 7 | \n",
" nationality chinese | \n",
" 11,675 | \n",
"
\n",
" 8 | \n",
" chinese birthplace | \n",
" 11,268 | \n",
"
\n",
" 9 | \n",
" birthplace canton | \n",
" 10,289 | \n",
"
\n",
" 10 | \n",
" for china | \n",
" 9,148 | \n",
"
\n",
" 11 | \n",
" china per | \n",
" 9,140 | \n",
"
\n",
" 12 | \n",
" canton departed | \n",
" 8,297 | \n",
"
\n",
" 13 | \n",
" returned to | \n",
" 7,009 | \n",
"
\n",
" 14 | \n",
" maru on | \n",
" 3,819 | \n",
"
\n",
" 15 | \n",
" townsville per | \n",
" 3,443 | \n",
"
\n",
" 16 | \n",
" brisbane per | \n",
" 3,172 | \n",
"
\n",
" 17 | \n",
" cairns per | \n",
" 2,994 | \n",
"
\n",
" 18 | \n",
" per eastern | \n",
" 2,948 | \n",
"
\n",
" 19 | \n",
" st albans | \n",
" 2,538 | \n",
"
\n",
" 20 | \n",
" eastern on | \n",
" 2,497 | \n",
"
\n",
" 21 | \n",
" per st | \n",
" 2,354 | \n",
"
\n",
" 22 | \n",
" to brisbane | \n",
" 2,015 | \n",
"
\n",
" 23 | \n",
" to townsville | \n",
" 2,002 | \n",
"
\n",
" 24 | \n",
" hong kong | \n",
" 1,980 | \n",
"
\n",
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Change ngram_count for larger ngrams (trigrams etc)\n",
"ngram_count = 2\n",
"series_details.display_top_ngrams(title_text, ngram_count)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}