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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{
"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": [],
"source": [
"df = pd.read_csv('akon_postcards_public_domain.csv.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": [
"28882"
]
},
"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>date</th>\n",
" <th>feature_class</th>\n",
" <th>feature_code</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",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0</td>\n",
" <td>AK111_024</td>\n",
" <td>74685</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>Kierling</td>\n",
" <td>True</td>\n",
" <td>1908</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>gelaufen 1908</td>\n",
" <td>P</td>\n",
" <td>PPL</td>\n",
" <td>2774449.0</td>\n",
" <td>48.30997</td>\n",
" <td>16.27616</td>\n",
" <td>Kierling</td>\n",
" <td>AT</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1 rows × 29 columns</p>\n",
"</div>"
],
"text/plain": [
" Unnamed: 0 akon_id id altitude building city color comment \\\n",
"0 0 AK111_024 74685 NaN NaN Kierling True 1908 \n",
"\n",
" mountain other ... date feature_class feature_code \\\n",
"0 NaN NaN ... gelaufen 1908 P PPL \n",
"\n",
" geoname_id latitude longitude name country_id admin_name_1 \\\n",
Loading full blame...