Commit 73d053b5 authored by christian.foerster's avatar christian.foerster

Examples for Pandas, Numpy, Statsmodels and Plotting added

parent 8aaaa572
......@@ -79,17 +79,6 @@
"**Mind the difference between \\/ and \\/\\/**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#Attention!\n",
"print(\"That's a: \", type(6/3))\n",
"print(\"And that's a \",type(6//3))\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -155,6 +144,56 @@
"# ...\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'\\nalso \\none\\n'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# multiline string\n",
"\"\"\"\n",
"this is one\n",
"...\n",
"\"\"\"\n",
"# and this\n",
"'''\n",
"also \n",
"one\n",
"'''"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# keep in mind\n",
"''==\"\""
]
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -162,6 +201,17 @@
"## Basic Math Hints"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#Attention!\n",
"print(\"That's a: \", type(6/3))\n",
"print(\"And that's a \",type(6//3))"
]
},
{
"cell_type": "code",
"execution_count": null,
......@@ -666,16 +716,6 @@
"matrix"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# list comprehension\n",
"[i**2 for i in range(10)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
......
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Pandas, (Numpy), Statsmodels and Plotting\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"#####################################################\n",
"## YOUR DATA\n",
"from sklearn import datasets\n",
"iris=datasets.load_iris()\n",
"\n",
"iris_data=iris.data\n",
"iris_header=iris.feature_names\n",
"iris_group=iris.target\n",
"iris_target_names=iris.target_names\n",
"####################################################"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**1. Convert data to a Pandas dataframe!**\n",
"\n",
"These columns must be in the dataframe:\n",
"\n",
"sepal_length | sepal_width | petal_length | petal_width | target_name\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**2. Plot the data to get a better feel for it. (Scattermatrix would be a good idea)**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**3. Now plot the data _grouped_ by target_name.**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**4. Create a multidimensional linear model that tries to guess the petal width depending on petal_length, sepal_width, sepal_length and check how well it fits!**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**5. Create Numpy array from the setosa sepal and petal values only!**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"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.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment