{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"tags": [
"s1",
"content",
"l1"
]
},
"source": [
"# The Data Story..\n",
"\n",
"## Clean and Messy Data\n",
"\n",
"Here are a few examples of what kinds of data we encounter:\n",
"
\n",
"\n",
"\n",
"\n",
"\n",
"
\n",
"## Exercise:\n",
"\n",
"What type of variations in the data do you see? What types of datasets do you observe?\n",
"\n",
"- click on the run button to continue with the workshop.\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true,
"tags": [
"s1",
"ce",
"l1"
]
},
"outputs": [],
"source": [
"# Clean & The Messy Data.\n",
"# This section will contain code examples that you can run to generate results as well as quizzes."
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"s1",
"l1",
"hint"
]
},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"tags": [
"s1",
"l1",
"ans"
]
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"tags": [
"s1",
"hid",
"l1"
]
},
"outputs": [],
"source": [
"ref_tmp_var = False\n",
"\n",
"\n",
"try:\n",
" ref_assert_var = True\n",
" \n",
" \n",
" \n",
" \n",
"except Exception:\n",
" print('Please follow the instructions given and use the same variables provided in the instructions.')\n",
"else:\n",
" if ref_assert_var:\n",
" ref_tmp_var = True\n",
" else:\n",
" print('Please follow the instructions given and use the same variables provided in the instructions.')\n",
"\n",
"\n",
"assert ref_tmp_var"
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"l2",
"content",
"s2"
]
},
"source": [
"\n",
"
\n",
"## Clustering - The Right Way\n",
"\n",
"Here is a list of Points of Interest in Venice as seen on a map:\n",
"
\n",
"\n",
"\n",
"\n",
"\n",
"
\n",
"## Exercise:\n",
"\n",
"- To see the clustering done the right way click on next."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true,
"tags": [
"l2",
"ce",
"s2"
]
},
"outputs": [],
"source": [
"from IPython.display import Image\n",
"Image(url='https://s3.amazonaws.com/rfjh/media/notebook-images/places.png') "
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"l2",
"s2",
"hint"
]
},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"tags": [
"l2",
"s2",
"ans"
]
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"tags": [
"l2",
"hid",
"s2"
]
},
"outputs": [],
"source": [
"ref_tmp_var = False\n",
"\n",
"\n",
"try:\n",
" ref_assert_var = True\n",
" \n",
" \n",
" \n",
" \n",
"except Exception:\n",
" print('Please follow the instructions given and use the same variables provided in the instructions.')\n",
"else:\n",
" if ref_assert_var:\n",
" ref_tmp_var = True\n",
" else:\n",
" print('Please follow the instructions given and use the same variables provided in the instructions.')\n",
"\n",
"\n",
"assert ref_tmp_var"
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"l3",
"s3",
"content"
]
},
"source": [
"\n",
"
\n",
"## Clustering - The Wrong Way\n",
"\n",
"Here is an image of 4 inter-leaved regions that we shall attempt to cluster. \n",
"\n",
"\n",
"## Exercise:\n",
"\n",
"Here, we have applied a clustering algorithm that doesnt quite work in getting us back the regions. \n",
"\n",
"- Continue to the next section."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true,
"tags": [
"l3",
"s3",
"ce"
]
},
"outputs": [],
"source": [
"from IPython.display import Image\n",
"Image(url='https://s3.amazonaws.com/rfjh/media/notebook-images/12-clusters.png') "
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"l3",
"s3",
"hint"
]
},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"tags": [
"l3",
"s3",
"ans"
]
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"tags": [
"l3",
"s3",
"hid"
]
},
"outputs": [],
"source": [
"ref_tmp_var = False\n",
"\n",
"\n",
"try:\n",
" ref_assert_var = True\n",
" \n",
" \n",
" \n",
" \n",
"except Exception:\n",
" print('Please follow the instructions given and use the same variables provided in the instructions.')\n",
"else:\n",
" if ref_assert_var:\n",
" ref_tmp_var = True\n",
" else:\n",
" print('Please follow the instructions given and use the same variables provided in the instructions.')\n",
"\n",
"\n",
"assert ref_tmp_var"
]
}
],
"metadata": {
"executed_sections": [],
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"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.5.2"
},
"rf_version": 14
},
"nbformat": 4,
"nbformat_minor": 2
}