{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"series = 'PP6/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 PP6/1
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Correspondence files [subject and client], annual single number series with 'H' infix
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Total items | 6,010 |
---|
Access status | |
---|
Not yet examined | 4,109 (68.37%) |
Open | 1,863 (31.00%) |
Open with exception | 33 (0.55%) |
Closed | 5 (0.08%) |
Number of items digitised | 245 (4.08%) |
---|
Number of pages digitised | 6,461 |
---|
Date of earliest content | 1906 |
---|
Date of latest content | 1978 |
---|
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",
" 326472 | \n",
" PP6/1 | \n",
" 1931/H/318 | \n",
" Maltese Migration | \n",
" 1931 - 1931 | \n",
" 1931-01-01 00:00:00 | \n",
" 1931-01-01 00:00:00 | \n",
" Open | \n",
" Perth | \n",
" False | \n",
" 0 | \n",
"
\n",
" 1 | \n",
" 326477 | \n",
" PP6/1 | \n",
" 1927/H/325 | \n",
" Ah Moy [Chinese] Application for Certificate of Exemption from Dictation Test [CEDT] [contains photos] | \n",
" 1911 - 1929 | \n",
" 1911-01-01 00:00:00 | \n",
" 1929-01-01 00:00:00 | \n",
" Open | \n",
" Perth | \n",
" False | \n",
" 0 | \n",
"
\n",
" 2 | \n",
" 326492 | \n",
" PP6/1 | \n",
" 1927/H/427 | \n",
" Immigration Act 1901-1925 Dictation Test [contains set of directions to be observed when applying test] | \n",
" 1927 - 1927 | \n",
" 1927-01-01 00:00:00 | \n",
" 1927-01-01 00:00:00 | \n",
" Open | \n",
" Perth | \n",
" True | \n",
" 5 | \n",
"
\n",
" 3 | \n",
" 326496 | \n",
" PP6/1 | \n",
" 1927/H/533 | \n",
" George Albert Orwin - Re son Leslie Orwin entering Australia suffering from exema | \n",
" 1927 - 1928 | \n",
" 1927-01-01 00:00:00 | \n",
" 1928-01-01 00:00:00 | \n",
" Open | \n",
" Perth | \n",
" False | \n",
" 0 | \n",
"
\n",
" 4 | \n",
" 326503 | \n",
" PP6/1 | \n",
" 1927/H/567 | \n",
" Applcation for admission of Eleanor Easom by her son Robert Easom | \n",
" 1927 - 1927 | \n",
" 1927-01-01 00:00:00 | \n",
" 1927-01-01 00:00:00 | \n",
" Open | \n",
" Perth | \n",
" False | \n",
" 0 | \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": [
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,
1957,
1958,
1959,
1960,
1961,
1962,
1963,
1964,
1965,
1966,
1967,
1968,
1969,
1970,
1971,
1972,
1973,
1974,
1975,
1976,
1977,
1978
],
"y": [
1,
1,
1,
1,
1,
1,
1,
2,
2,
2,
2,
2,
2,
2,
3,
4,
10,
5,
8,
7,
6,
7,
4,
4,
3,
4,
6,
6,
4,
5,
7,
5,
6,
7,
17,
52,
87,
115,
117,
49,
13,
3,
2,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
},
{
"name": "Not digitised",
"type": "bar",
"x": [
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,
1957,
1958,
1959,
1960,
1961,
1962,
1963,
1964,
1965,
1966,
1967,
1968,
1969,
1970,
1971,
1972,
1973,
1974,
1975,
1976
],
"y": [
2,
3,
3,
3,
3,
6,
8,
10,
11,
12,
12,
12,
14,
15,
17,
20,
22,
22,
26,
29,
50,
67,
145,
102,
101,
84,
88,
102,
99,
87,
76,
86,
77,
94,
78,
87,
93,
95,
110,
102,
363,
969,
1839,
2743,
2582,
910,
243,
103,
44,
27,
26,
25,
24,
23,
16,
9,
7,
6,
5,
4,
4,
3,
3,
3,
3,
3,
3,
3,
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",
" 5 | \n",
" application | \n",
" 4,983 | \n",
"
\n",
" 26 | \n",
" australia | \n",
" 4,325 | \n",
"
\n",
" 30 | \n",
" admission | \n",
" 4,156 | \n",
"
\n",
" 948 | \n",
" naturalisation | \n",
" 578 | \n",
"
\n",
" 380 | \n",
" giuseppe | \n",
" 522 | \n",
"
\n",
" 459 | \n",
" maria | \n",
" 342 | \n",
"
\n",
" 100 | \n",
" antonio | \n",
" 335 | \n",
"
\n",
" 2177 | \n",
" giovanni | \n",
" 297 | \n",
"
\n",
" 357 | \n",
" francesco | \n",
" 250 | \n",
"
\n",
" 492 | \n",
" domenico | \n",
" 214 | \n",
"
\n",
" 394 | \n",
" vincenzo | \n",
" 196 | \n",
"
\n",
" 42 | \n",
" john | \n",
" 196 | \n",
"
\n",
" 20 | \n",
" george | \n",
" 172 | \n",
"
\n",
" 504 | \n",
" luigi | \n",
" 168 | \n",
"
\n",
" 892 | \n",
" de | \n",
" 165 | \n",
"
\n",
" 323 | \n",
" permanent | \n",
" 158 | \n",
"
\n",
" 7 | \n",
" exemption | \n",
" 153 | \n",
"
\n",
" 482 | \n",
" pietro | \n",
" 150 | \n",
"
\n",
" 6 | \n",
" certificate | \n",
" 140 | \n",
"
\n",
" 1689 | \n",
" residence | \n",
" 136 | \n",
"
\n",
" 881 | \n",
" salvatore | \n",
" 131 | \n",
"
\n",
" 884 | \n",
" angelo | \n",
" 128 | \n",
"
\n",
" 1295 | \n",
" carmelo | \n",
" 110 | \n",
"
\n",
" 455 | \n",
" michele | \n",
" 108 | \n",
"
\n",
" 195 | \n",
" peter | \n",
" 93 | \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",
" application for | \n",
" 4,907 | \n",
"
\n",
" 1 | \n",
" to australia | \n",
" 4,099 | \n",
"
\n",
" 2 | \n",
" for admission | \n",
" 4,065 | \n",
"
\n",
" 3 | \n",
" admission of | \n",
" 4,006 | \n",
"
\n",
" 4 | \n",
" for naturalisation | \n",
" 542 | \n",
"
\n",
" 5 | \n",
" of giuseppe | \n",
" 176 | \n",
"
\n",
" 6 | \n",
" australia giuseppe | \n",
" 166 | \n",
"
\n",
" 7 | \n",
" in australia | \n",
" 145 | \n",
"
\n",
" 8 | \n",
" of exemption | \n",
" 142 | \n",
"
\n",
" 9 | \n",
" permanent residence | \n",
" 132 | \n",
"
\n",
" 10 | \n",
" for permanent | \n",
" 128 | \n",
"
\n",
" 11 | \n",
" certificate of | \n",
" 124 | \n",
"
\n",
" 12 | \n",
" australia giovanni | \n",
" 118 | \n",
"
\n",
" 13 | \n",
" of maria | \n",
" 112 | \n",
"
\n",
" 14 | \n",
" for certificate | \n",
" 106 | \n",
"
\n",
" 15 | \n",
" residence in | \n",
" 104 | \n",
"
\n",
" 16 | \n",
" australia antonio | \n",
" 99 | \n",
"
\n",
" 17 | \n",
" of francesco | \n",
" 98 | \n",
"
\n",
" 18 | \n",
" australia john | \n",
" 83 | \n",
"
\n",
" 19 | \n",
" admission to | \n",
" 81 | \n",
"
\n",
" 20 | \n",
" of antonio | \n",
" 77 | \n",
"
\n",
" 21 | \n",
" of giovanni | \n",
" 76 | \n",
"
\n",
" 22 | \n",
" australia vincenzo | \n",
" 74 | \n",
"
\n",
" 23 | \n",
" of domenico | \n",
" 68 | \n",
"
\n",
" 24 | \n",
" australia domenico | \n",
" 68 | \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
}