{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"series = 'SP115/1'"
]
},
{
"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 SP115/1
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Folders containing Certificates of Exemption and related papers for passengers arriving in Australia by ship, chronological series
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Total items | 1,787 |
---|
Access status | |
---|
Open | 1,787 (100.00%) |
Number of items digitised | 9 (0.50%) |
---|
Number of pages digitised | 285 |
---|
Date of earliest content | 1884 |
---|
Date of latest content | 1943 |
---|
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": 5,
"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",
" 1592127 | \n",
" SP115/1 | \n",
" UGANDA - 13/05/1915 [BOX 15] | \n",
" UGANDA - Date of Arrival 13/05/1915 - [Certificates of Exemption for passengers; includes photographs and hand prints][Box 15] | \n",
" 1912 - 1915 | \n",
" 1912-01-01 00:00:00 | \n",
" 1915-01-01 00:00:00 | \n",
" Open | \n",
" Sydney | \n",
" False | \n",
" 0 | \n",
"
\n",
" 1 | \n",
" 1592383 | \n",
" SP115/1 | \n",
" JOSEPH SIMMS - 13/05/1915 [BOX 15] | \n",
" JOSEPH SIMMS - Date of Arrival 13/05/1915 [Certificates of Exemption for passengers; includes photographs and hand prints][Box 15] | \n",
" 1914 - 1915 | \n",
" 1914-01-01 00:00:00 | \n",
" 1915-01-01 00:00:00 | \n",
" Open | \n",
" Sydney | \n",
" False | \n",
" 0 | \n",
"
\n",
" 2 | \n",
" 1592840 | \n",
" SP115/1 | \n",
" TAIYUAN - [PART 1] - 30/05/1915 [BOX 15] | \n",
" TAIYUAN - [Part 1] - Date of Arrival 30/05/1915 - [Certificates of Exemption for passengers; includes photographs and hand prints][[Box 15] | \n",
" 1914 - 1915 | \n",
" 1914-01-01 00:00:00 | \n",
" 1915-01-01 00:00:00 | \n",
" Open | \n",
" Sydney | \n",
" False | \n",
" 0 | \n",
"
\n",
" 3 | \n",
" 1592858 | \n",
" SP115/1 | \n",
" TAIYUAN -[PART 2] - 30/05/1915 [BOX 15] | \n",
" TAIYUAN -[Part 2] - Date of Arrival 30/05/1915 - [Certificates of Exemption for passengers; includes photographs and hand prints][Box 15] | \n",
" 1905 - 1915 | \n",
" 1905-01-01 00:00:00 | \n",
" 1915-01-01 00:00:00 | \n",
" Open | \n",
" Sydney | \n",
" False | \n",
" 0 | \n",
"
\n",
" 4 | \n",
" 1592871 | \n",
" SP115/1 | \n",
" EASTERN - [PART 1] - 05/06/1915 [BOX 15] | \n",
" EASTERN - [Part 1] - Date of Arrival 05/06/1915 [Certificates of Exemption for passengers; includes photographs and hand prints][Box 15] | \n",
" 1914 - 1915 | \n",
" 1914-01-01 00:00:00 | \n",
" 1915-01-01 00:00:00 | \n",
" Open | \n",
" Sydney | \n",
" False | \n",
" 0 | \n",
"
\n",
"
"
],
"text/plain": [
""
]
},
"execution_count": 5,
"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": 6,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"data": [
{
"name": "Digitised",
"type": "bar",
"x": [
1915,
1916,
1917,
1918,
1919,
1920,
1921,
1922,
1923,
1924,
1925,
1942
],
"y": [
1,
1,
1,
1,
3,
3,
2,
2,
3,
3,
2,
1
]
},
{
"name": "Not digitised",
"type": "bar",
"x": [
1884,
1885,
1886,
1887,
1888,
1889,
1890,
1891,
1892,
1893,
1894,
1895,
1896,
1897,
1898,
1899,
1900,
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,
1926,
1927,
1928,
1929,
1930,
1931,
1932,
1933,
1934,
1935,
1936,
1937,
1938,
1939,
1940,
1941,
1942,
1943
],
"y": [
1,
1,
1,
1,
1,
1,
1,
2,
2,
2,
2,
2,
2,
2,
2,
3,
4,
5,
5,
10,
16,
25,
39,
57,
83,
159,
224,
331,
341,
329,
337,
359,
350,
301,
291,
293,
285,
269,
263,
258,
239,
203,
174,
191,
272,
279,
258,
225,
201,
182,
180,
165,
142,
119,
103,
72,
41,
23,
2,
2
]
}
],
"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": 7,
"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": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" \n",
" \n",
" | \n",
" word | \n",
" count | \n",
"
\n",
" \n",
" 4 | \n",
" certificates | \n",
" 1,773 | \n",
"
\n",
" 11 | \n",
" box | \n",
" 1,763 | \n",
"
\n",
" 5 | \n",
" exemption | \n",
" 1,697 | \n",
"
\n",
" 6 | \n",
" passengers | \n",
" 1,696 | \n",
"
\n",
" 7 | \n",
" includes | \n",
" 1,690 | \n",
"
\n",
" 1 | \n",
" date | \n",
" 1,687 | \n",
"
\n",
" 8 | \n",
" photographs | \n",
" 1,684 | \n",
"
\n",
" 2 | \n",
" arrival | \n",
" 1,682 | \n",
"
\n",
" 9 | \n",
" hand | \n",
" 1,612 | \n",
"
\n",
" 10 | \n",
" prints | \n",
" 1,612 | \n",
"
\n",
" 31 | \n",
" pages | \n",
" 664 | \n",
"
\n",
" 16 | \n",
" part | \n",
" 628 | \n",
"
\n",
" 39 | \n",
" 2cm | \n",
" 415 | \n",
"
\n",
" 17 | \n",
" 1 | \n",
" 388 | \n",
"
\n",
" 19 | \n",
" 2 | \n",
" 255 | \n",
"
\n",
" 60 | \n",
" maru | \n",
" 189 | \n",
"
\n",
" 22 | \n",
" 3 | \n",
" 169 | \n",
"
\n",
" 23 | \n",
" 4 | \n",
" 156 | \n",
"
\n",
" 36 | \n",
" st | \n",
" 140 | \n",
"
\n",
" 58 | \n",
" 1cm | \n",
" 137 | \n",
"
\n",
" 37 | \n",
" albans | \n",
" 135 | \n",
"
\n",
" 24 | \n",
" 5 | \n",
" 130 | \n",
"
\n",
" 20 | \n",
" eastern | \n",
" 126 | \n",
"
\n",
" 749 | \n",
" taiping | \n",
" 119 | \n",
"
\n",
" 689 | \n",
" tanda | \n",
" 105 | \n",
"
\n",
"
"
],
"text/plain": [
""
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"series_details.display_word_counts(title_text)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" \n",
" \n",
" | \n",
" ngram | \n",
" count | \n",
"
\n",
" \n",
" 0 | \n",
" of exemption | \n",
" 1,697 | \n",
"
\n",
" 1 | \n",
" exemption for | \n",
" 1,696 | \n",
"
\n",
" 2 | \n",
" for passengers | \n",
" 1,696 | \n",
"
\n",
" 3 | \n",
" passengers includes | \n",
" 1,689 | \n",
"
\n",
" 4 | \n",
" date of | \n",
" 1,687 | \n",
"
\n",
" 5 | \n",
" certificates of | \n",
" 1,686 | \n",
"
\n",
" 6 | \n",
" includes photographs | \n",
" 1,683 | \n",
"
\n",
" 7 | \n",
" photographs and | \n",
" 1,683 | \n",
"
\n",
" 8 | \n",
" of arrival | \n",
" 1,682 | \n",
"
\n",
" 9 | \n",
" hand prints | \n",
" 1,612 | \n",
"
\n",
" 10 | \n",
" and hand | \n",
" 1,606 | \n",
"
\n",
" 11 | \n",
" pages box | \n",
" 655 | \n",
"
\n",
" 12 | \n",
" 2cm box | \n",
" 404 | \n",
"
\n",
" 13 | \n",
" prints 2cm | \n",
" 399 | \n",
"
\n",
" 14 | \n",
" prints box | \n",
" 350 | \n",
"
\n",
" 15 | \n",
" 1 date | \n",
" 233 | \n",
"
\n",
" 16 | \n",
" part 1 | \n",
" 232 | \n",
"
\n",
" 17 | \n",
" part 2 | \n",
" 220 | \n",
"
\n",
" 18 | \n",
" 2 date | \n",
" 218 | \n",
"
\n",
" 19 | \n",
" 1cm box | \n",
" 136 | \n",
"
\n",
" 20 | \n",
" st albans | \n",
" 135 | \n",
"
\n",
" 21 | \n",
" prints 1cm | \n",
" 118 | \n",
"
\n",
" 22 | \n",
" eastern part | \n",
" 115 | \n",
"
\n",
" 23 | \n",
" 3 date | \n",
" 112 | \n",
"
\n",
" 24 | \n",
" part 3 | \n",
" 111 | \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
}