{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"series = 'D1915'"
]
},
{
"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 D1915
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Investigation case files, single number series with 'SA' (South Australia) prefix
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Total items | 4,884 |
---|
Access status | |
---|
Open | 2,703 (55.34%) |
Not yet examined | 2,007 (41.09%) |
Open with exception | 101 (2.07%) |
Closed | 73 (1.49%) |
Number of items digitised | 203 (4.16%) |
---|
Number of pages digitised | 13,917 |
---|
Date of earliest content | 1800 |
---|
Date of latest content | 1987 |
---|
"
],
"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",
" 277752 | \n",
" D1915 | \n",
" SA20047 | \n",
" Wehrbouern Scheme - Peasant Guards | \n",
" 1939 - 1943 | \n",
" 1939-01-01 00:00:00 | \n",
" 1943-01-01 00:00:00 | \n",
" Open | \n",
" Adelaide | \n",
" False | \n",
" 0 | \n",
"
\n",
" 1 | \n",
" 323055 | \n",
" D1915 | \n",
" SA13 | \n",
" Circulars [includes instructions for surveillance of Sinn Fein activities] | \n",
" 1917 - 1924 | \n",
" 1917-01-01 00:00:00 | \n",
" 1924-01-01 00:00:00 | \n",
" Open | \n",
" Adelaide | \n",
" True | \n",
" 54 | \n",
"
\n",
" 2 | \n",
" 323062 | \n",
" D1915 | \n",
" SA26 | \n",
" Intelligence enquiries - co-ordination of [consists mainly of intelligence reports of persons under suspicion in South Australia] | \n",
" 1918 - 1919 | \n",
" 1918-01-01 00:00:00 | \n",
" 1919-01-01 00:00:00 | \n",
" Open | \n",
" Adelaide | \n",
" True | \n",
" 193 | \n",
"
\n",
" 3 | \n",
" 323065 | \n",
" D1915 | \n",
" SA82 | \n",
" Mormons - movements of | \n",
" 1922 - 1922 | \n",
" 1922-01-01 00:00:00 | \n",
" 1922-01-01 00:00:00 | \n",
" Open | \n",
" Adelaide | \n",
" False | \n",
" 0 | \n",
"
\n",
" 4 | \n",
" 323069 | \n",
" D1915 | \n",
" SA96 | \n",
" Germans - projected settlement in South Australia | \n",
" 1919 - 1924 | \n",
" 1919-01-01 00:00:00 | \n",
" 1924-01-01 00:00:00 | \n",
" Open | \n",
" Adelaide | \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": [
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,
1979,
1980,
1981,
1982,
1983,
1984,
1985
],
"y": [
7,
16,
25,
27,
32,
33,
42,
49,
39,
36,
39,
33,
34,
38,
41,
37,
36,
42,
43,
47,
49,
54,
54,
54,
53,
58,
63,
59,
65,
84,
75,
64,
41,
30,
29,
23,
17,
15,
10,
5,
5,
6,
7,
5,
8,
9,
7,
5,
5,
3,
3,
3,
3,
3,
3,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
},
{
"name": "Not digitised",
"type": "bar",
"x": [
1800,
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,
1977,
1978,
1979,
1980,
1981,
1982,
1983,
1984,
1985,
1986,
1987
],
"y": [
1,
2,
2,
2,
3,
21,
57,
120,
149,
198,
241,
355,
466,
324,
325,
317,
303,
297,
339,
374,
411,
476,
485,
555,
523,
515,
519,
524,
528,
535,
640,
764,
855,
1275,
2014,
1718,
1215,
814,
691,
602,
498,
435,
354,
259,
210,
214,
193,
210,
361,
524,
426,
203,
164,
144,
123,
104,
100,
95,
76,
57,
50,
46,
45,
44,
44,
41,
38,
37,
36,
36,
36,
36,
36,
36,
36,
36,
36,
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": 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",
" 137 | \n",
" naturalization | \n",
" 972 | \n",
"
\n",
" 120 | \n",
" application | \n",
" 803 | \n",
"
\n",
" 189 | \n",
" naturalisation | \n",
" 478 | \n",
"
\n",
" 136 | \n",
" sa | \n",
" 401 | \n",
"
\n",
" 77 | \n",
" german | \n",
" 313 | \n",
"
\n",
" 199 | \n",
" nationality | \n",
" 251 | \n",
"
\n",
" 127 | \n",
" enquiry | \n",
" 199 | \n",
"
\n",
" 100 | \n",
" also | \n",
" 192 | \n",
"
\n",
" 20 | \n",
" australia | \n",
" 179 | \n",
"
\n",
" 278 | \n",
" john | \n",
" 137 | \n",
"
\n",
" 628 | \n",
" admission | \n",
" 133 | \n",
"
\n",
" 1578 | \n",
" giovanni | \n",
" 122 | \n",
"
\n",
" 115 | \n",
" adelaide | \n",
" 122 | \n",
"
\n",
" 1863 | \n",
" antonio | \n",
" 122 | \n",
"
\n",
" 1860 | \n",
" giuseppe | \n",
" 120 | \n",
"
\n",
" 180 | \n",
" immigration | \n",
" 117 | \n",
"
\n",
" 476 | \n",
" george | \n",
" 110 | \n",
"
\n",
" 118 | \n",
" carl | \n",
" 96 | \n",
"
\n",
" 1140 | \n",
" whereabouts | \n",
" 89 | \n",
"
\n",
" 1983 | \n",
" luigi | \n",
" 82 | \n",
"
\n",
" 119 | \n",
" wilhelm | \n",
" 81 | \n",
"
\n",
" 605 | \n",
" william | \n",
" 79 | \n",
"
\n",
" 221 | \n",
" friedrich | \n",
" 79 | \n",
"
\n",
" 282 | \n",
" heinrich | \n",
" 78 | \n",
"
\n",
" 102 | \n",
" war | \n",
" 77 | \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",
" application for | \n",
" 734 | \n",
"
\n",
" 1 | \n",
" for naturalization | \n",
" 535 | \n",
"
\n",
" 2 | \n",
" sa application | \n",
" 338 | \n",
"
\n",
" 3 | \n",
" naturalization german | \n",
" 202 | \n",
"
\n",
" 4 | \n",
" for naturalisation | \n",
" 161 | \n",
"
\n",
" 5 | \n",
" german nationality | \n",
" 146 | \n",
"
\n",
" 6 | \n",
" admission of | \n",
" 107 | \n",
"
\n",
" 7 | \n",
" by immigration | \n",
" 102 | \n",
"
\n",
" 8 | \n",
" enquiry re | \n",
" 83 | \n",
"
\n",
" 9 | \n",
" enquiry by | \n",
" 82 | \n",
"
\n",
" 10 | \n",
" to australia | \n",
" 74 | \n",
"
\n",
" 11 | \n",
" applicant for | \n",
" 71 | \n",
"
\n",
" 12 | \n",
" nationality also | \n",
" 63 | \n",
"
\n",
" 13 | \n",
" of war | \n",
" 55 | \n",
"
\n",
" 14 | \n",
" naturalization syrian | \n",
" 52 | \n",
"
\n",
" 15 | \n",
" prisoner of | \n",
" 47 | \n",
"
\n",
" 16 | \n",
" adelaide application | \n",
" 44 | \n",
"
\n",
" 17 | \n",
" war internee | \n",
" 40 | \n",
"
\n",
" 18 | \n",
" also application | \n",
" 39 | \n",
"
\n",
" 19 | \n",
" re by | \n",
" 39 | \n",
"
\n",
" 20 | \n",
" return to | \n",
" 38 | \n",
"
\n",
" 21 | \n",
" on parole | \n",
" 35 | \n",
"
\n",
" 22 | \n",
" south australia | \n",
" 34 | \n",
"
\n",
" 23 | \n",
" for passport | \n",
" 34 | \n",
"
\n",
" 24 | \n",
" to return | \n",
" 33 | \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": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"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
}