Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# AKON Metadata - Data Overview"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Get a first impression of the postcard metadata*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Using the [Pandas Python Data Analysis Library](https://pandas.pydata.org/).\n",
"\n",
"For an intro to pandas feel free to take a look at this [Workshop for CBioVikings](https://github.com/dblyon/PandasIntro) by David Lyon."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Load Data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`df` stands for *Data Frame*"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/kst/tmp/dingsdi/lib/python3.7/site-packages/IPython/core/interactiveshell.py:3049: DtypeWarning: Columns (13) have mixed types. Specify dtype option on import or set low_memory=False.\n",
" interactivity=interactivity, compiler=compiler, result=result)\n"
]
}
],
"df = pd.read_csv('https://labs.onb.ac.at/gitlab/labs-team/raw-metadata/raw/master/akon_postcards_public_domain.csv.bz2', compression='bz2')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## View Data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Rough Overview"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"How much datasets are in there?"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(df)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"What does a dataset look like?\n",
"Show me the first one!"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Unnamed: 0</th>\n",
" <th>akon_id</th>\n",
" <th>id</th>\n",
" <th>altitude</th>\n",
" <th>building</th>\n",
" <th>city</th>\n",
" <th>color</th>\n",
" <th>comment</th>\n",
" <th>mountain</th>\n",
" <th>other</th>\n",
" <th>...</th>\n",
" <th>geoname_id</th>\n",
" <th>latitude</th>\n",
" <th>longitude</th>\n",
" <th>name</th>\n",
" <th>country_id</th>\n",
" <th>admin_name_1</th>\n",
" <th>admin_code_1</th>\n",
" <th>geo</th>\n",
" <th>download_link</th>\n",
" <th>download_link_256x256</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0</td>\n",
" <td>AK111_021</td>\n",
" <td>74682</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>Kiel, Blücherplatz</td>\n",
" <td>False</td>\n",
" <td>1921 gel</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>2891122.0</td>\n",
" <td>54.32133</td>\n",
" <td>10.13489</td>\n",
" <td>Kiel</td>\n",
" <td>DE</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>54.32133, 10.13489</td>\n",
" <td>https://iiif.onb.ac.at/images/AKON/AK111_021/0...</td>\n",
" <td>https://iiif.onb.ac.at/images/AKON/AK111_021/0...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1 rows × 32 columns</p>\n",
Loading full blame...