Skip to content

Commit

Permalink
updated fonts, separated setup instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwallis committed Mar 6, 2015
1 parent 43f555a commit 976e288
Show file tree
Hide file tree
Showing 8 changed files with 266 additions and 133 deletions.
128 changes: 7 additions & 121 deletions index.ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:5645621dffc3e26d39ce826c4f22ed3013817a457e687fa94152541cc42b7e8d"
"signature": "sha256:b0230e2c391d363a04ed8d177db84780f6641a74753aba55aa1cbdbb0c8497a5"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand All @@ -25,7 +25,7 @@
"source": [
"This course provides an overview of an extremely flexible\n",
"statistical framework for describing and performing inference with a wide\n",
"variety of data types: the Generalised Linear Model (GLM). Many common statistical procedures are special cases of the GLM. In the course, we focus on the construction and understanding of design matrices (using S-style formula notation) and the interpretation of regression weights. We mostly concentrate on the linear Gaussian model, before discussing more general cases. We also touch on how this framework relates to ANOVA-style model comparison.\n",
"variety of data types: the Generalised Linear Model (GLM). Many common statistical procedures are special cases of the GLM. In the course, we focus on the construction and understanding of design matrices and the interpretation of regression weights. We mostly concentrate on the linear Gaussian model, before discussing more general cases. We also touch on how this framework relates to ANOVA-style model comparison.\n",
"\n",
"The course was designed and presented as a six week elective statistics course for graduate students in the neuroscience program at the University of T\u00fcbingen, in January 2015. Lectures were presented as a collection of IPython Notebooks. While the notebooks are (we hope) well documented, they *are* lecture materials rather than a textbook. As such, some content might not be self-explanatory. \n",
"\n",
Expand Down Expand Up @@ -120,123 +120,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"---------------------------------------\n",
"--------------------------------\n",
"\n",
"# Setting up Python\n",
"\n",
"## Short version for those familiar with Python\n",
"\n",
"The course materials use Python 3.4 along with the following packages and versions:\n",
"\n",
" pandas 0.15.2\n",
" patsy 0.3.0\n",
" scipy 0.15.1\n",
" seaborn 0.5.1\n",
" statsmodels 0.6.1\n",
"\n",
"\n",
"## Longer version\n",
"\n",
"We used Python 3.4 along with a number of additional packages in the course. This document specifies the steps needed to set up the environment on your computer. It assumes you have already installed the Anaconda Python distribution (Python 3.4) from [here](http://store.continuum.io/cshop/anaconda/).\n",
"\n",
"The Anaconda distribution is a set of software libraries, including the core Python language, something called the `conda` utility, and a number of additional libraries.\n",
"\n",
"The conda utility can manage the *libraries* (also called *packages* or *modules*, which are extensions to the Python language that allow for things like statistics) we want to use.\n",
"\n",
"### Checking that conda is working\n",
"\n",
"Linux / Mac OSX: Open a terminal (command prompt). \n",
"\n",
"Windows: type \"anaconda\" into the search field of the start menu and start the \"anaconda command prompt\"\n",
"\n",
"At the command line, type `conda list`, which should return a list of all the python packages in your default python environment. It might look something like this (longer list if you have used the default anaconda distribution):\n",
"\n",
"```\n",
"conda 3.7.4 py34_0 \n",
"openssl 1.0.1j 4 \n",
"pip 1.5.6 py34_0 \n",
"pycosat 0.6.1 py34_0 \n",
"python 3.4.2 0 \n",
"pyyaml 3.11 py34_0 \n",
"readline 6.2 2 \n",
"requests 2.5.1 py34_0 \n",
"setuptools 3.6 py34_0 \n",
"sqlite 3.8.4.1 0 \n",
"tk 8.5.15 0 \n",
"xz 5.0.5 0 \n",
"yaml 0.1.4 1 \n",
"zlib 1.2.7 1 \n",
"```\n",
"\n",
"The left column is the package name and the middle column is the package version. \n",
"\n",
"If this doesn't work for you (e.g. if the prompt reports that it doesn't know what `conda` is) then the anaconda distribution has not been correctly configured on your computer.\n",
"\n",
"You can find more information about the conda package manager [here](http://conda.pydata.org/index.html).\n",
"\n",
"\n",
"### Upgrading packages\n",
"\n",
"Some of the packages installed by Anaconda aren't the most recent version available. We want to use the most recent versions where possible, so we're going to upgrade those packages manually using the `conda` tool (or `pip` if necessary, which is another tool that does essentially the same).\n",
"\n",
"For example, if you type `conda list` and look down the resulting list of packages, you'll see that the package `pandas` is version 0.14.1. We want to use the more recent 0.15.\n",
"\n",
"Now, type\n",
"\n",
" conda install pandas\n",
"\n",
"this will report that we're upgrading `pandas` to version 0.15.2, and that to do this, a bunch of other packages will need to also be upgraded. One nice thing about using `conda` is that it will look after all these dependencies for us. \n",
"\n",
"Press `y` to proceed. Once these packages have downloaded and installed, we'll do the next one. I'm just going to write the install commands below. The procedure is the same as above.\n",
"\n",
" conda install statsmodels\n",
" pip install ggplot\n",
" conda install seaborn\n",
" conda install ipython-notebook\n",
"\n",
"That should be it! If all the steps above proceeded successfully, everyone in the course should now be using the same package versions. That means that when we find bugs (we probably will), at least they're the same for everyone.\n",
"\n",
"To check, type `conda list` again. Look down the list. You should be using the following versions: \n",
"\n",
" pandas 0.15.2\n",
" patsy 0.3.0\n",
" scipy 0.15.1\n",
" seaborn 0.5.1\n",
" statsmodels 0.6.1\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## The IPython notebook\n",
"\n",
"There are a number of different ways to use Python for data analysis. In this course we will encourage you to use the IPython Notebook. \n",
"\n",
"### Starting the notebook server\n",
"\n",
"Linux / Mac OSX: open the Anaconda Launcher, and click \"IPython Notebook\".\n",
"\n",
"Windows: type ipython notebook into the start menu search field, and click \"IPython Notebook\".\n",
"\n",
"The IPython Notebook is a file format (extension .ipynb) that allows you to integrate text, code and figures into a single document. You view the document using a web browser, and it can be exported into formats like html and pdf, if you want to give people a static (i.e. not interactive) document.\n",
"\n",
"Think of the Notebook like a lab notebook: you can write down some ideas about what you want to do and how you want to do it. The advantage of using this electronic format, though, is that you can now include the code that run your analysis and the outputs that result. It becomes a living, interactive document. \n",
"\n",
"Take some time to familiarise yourself with the notebook. You can find many tutorials online. For example, try [this](http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/Notebook/Running%20Code.ipynb), [this](https://opentechschool.github.io/python-data-intro/core/notebook.html) or [this](https://www.youtube.com/watch?v=DUCQ_HZamhs). Note that you can skip all the \"installing python\" steps, since we've done that already. You can also see [this page](https://github.com/ipython/ipython/wiki/A-gallery-of-interesting-IPython-Notebooks#introductory-tutorials) for a list of interesting ipython notebooks available on the web.\n",
"\n",
"We will be providing you with some example notebook files that you will be able to run. During the course you will work on your own notebooks for data analysis. Feel free to copy code from our notebooks into yours."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Packages and documentation\n",
"\n",
"During the course we will use a number of packages to analyse data in Python. These are all open source packages, maintained and developed by teams of volunteers around the world. You can find all the documentation for any package we're using by doing a web search for the package names. \n",
"\n",
"The main packages we will use are [Pandas](http://pandas.pydata.org/pandas-docs/stable/index.html), [statsmodels](http://statsmodels.sourceforge.net/stable/index.html), and for plotting, [Seaborn](http://stanford.edu/~mwaskom/software/seaborn/). If you are having trouble with commands from the packages we're using, refer there for help first."
"[Here are some notes](setup_python.ipynb) on how we set up a Python environment for the course (packages, versions) etc."
]
},
{
Expand Down Expand Up @@ -342,13 +228,13 @@
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 5,
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x106d7cf60>"
"<IPython.core.display.HTML at 0x106e0d9b0>"
]
}
],
"prompt_number": 5
"prompt_number": 1
}
],
"metadata": {}
Expand Down
4 changes: 2 additions & 2 deletions lectures/ANOVA.ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:45e2c11c36161e59d75823948a1e838d993b77e12a76c43bc2785df1486b9b7a"
"signature": "sha256:06aaaf7085ddd47dd0b96d93bf3c322d5569eeaac8e2cb804e1a926e01aa02e8"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand Down Expand Up @@ -1168,7 +1168,7 @@
"output_type": "pyout",
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x104d317b8>"
"<IPython.core.display.HTML at 0x105d22940>"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions lectures/Interactions.ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:8bd4a8ffb620f9db21f621b2b66e5e0e2b49c117b19da118459e784cfc5c1678"
"signature": "sha256:67af23ba4294037fb1cf49d4893b8ff8cceac328461971523108b2287c21378b"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand Down Expand Up @@ -1224,7 +1224,7 @@
"output_type": "pyout",
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x1051a8cc0>"
"<IPython.core.display.HTML at 0x104d0ccc0>"
]
}
],
Expand Down
6 changes: 3 additions & 3 deletions lectures/dataframes_plots.ipynb
Expand Up @@ -1606,13 +1606,13 @@
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 2,
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x106e4d6a0>"
"<IPython.core.display.HTML at 0x105e0c908>"
]
}
],
"prompt_number": 2
"prompt_number": 1
}
],
"metadata": {}
Expand Down
2 changes: 1 addition & 1 deletion lectures/design_matrices.ipynb
Expand Up @@ -2018,7 +2018,7 @@
"output_type": "pyout",
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x106e0c940>"
"<IPython.core.display.HTML at 0x1054317b8>"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions lectures/homework_solution_1.ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:ec1c488872c6c57cd2c7df217f0a6cfedd6a522e7ec700860a9ae58cd6c348fb"
"signature": "sha256:f96883adbb1cc2cab5d47377b66477efdc51fa12b8c7e1c2cede59ba06cbdff5"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand Down Expand Up @@ -1261,7 +1261,7 @@
"output_type": "pyout",
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x106e0c940>"
"<IPython.core.display.HTML at 0x105e0ccc0>"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions lectures/link_functions.ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:62a3379086d139f18a60dcec4fe2c8e9d99671590360473f09075f8fd6f1ee19"
"signature": "sha256:abd6c526f79cc9b7b6c13dc21be67aa3f1bd57c52e53a2f0e437a29aaea4412e"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand Down Expand Up @@ -1628,7 +1628,7 @@
"output_type": "pyout",
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x10640a8d0>"
"<IPython.core.display.HTML at 0x105e0c908>"
]
}
],
Expand Down

0 comments on commit 976e288

Please sign in to comment.