{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true, "nbpresent": { "id": "7fc0cefe-8b1c-4ca9-aa39-094614969842" } }, "source": [ "# Introduction\n", "\n", "Welcome to the hands on materials for Data Science in Practice.\n", "\n", "This notebook will guide through getting the tools you will need for working with these tutorials and assignments." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Alerts" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Throughout these tutorials, you will see colored 'alert' text:\n", "\n", "
\n", "Green alerts provide key information and definitions.\n", "
\n", "\n", "
\n", "Blue alerts provide links out to further \n", "resources. \n", "
" ] }, { "cell_type": "markdown", "metadata": { "nbpresent": { "id": "b6153143-e694-4e86-96b0-243f56bad8d5" } }, "source": [ "## What do you need for these tutorials?\n", "\n", "### Software\n", "\n", "- Working install of Python (>= 3.6), with the anaconda distribution\n", " - If you are in the official class, [datahub](http://datahub.ucsd.edu) satisfies this requirement\n", "- Jupyter Notebooks\n", " - Also satisfied by [datahub](http://datahub.ucsd.edu)\n", "- git and a GitHub account" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Prerequisites\n", "\n", "These tutorials presume that you do already have some basic knowledge of programming. \n", "\n", "In particular, it assumes knowledge of the Python programming language and standard library. \n", "\n", "If you are somewhat unfamiliar with Python, you can follow the links in the Python notebook to catch up." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Computational Resources\n", "\n", "The examples throughout these tutorials, and in the assignments are not computationally heavy. \n", "\n", "You should be able to run all these materials on any computer you have access to, assuming it will run the aforementioned tools. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Installing Python\n", "\n", "- If you are running code locally, we recommend you install a new version of Python with Anaconda, as described below\n", " - If you are in the official course, you can use [datahub](http://datahub.ucsd.edu) for everything you need\n", "- If you are on Mac, you have a native installation of python. This native installation of Python may be older, will not include the extra packages that you will need for this class, and is best left untouched. \n", " - Downloading Anaconda will install a separate, independent install of Python, leaving your native install untouched. \n", "- Windows does not require Python natively and so it is not typically pre-installed." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Tools\n", "\n", "The following are a series of tools that you will need for this class" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "\n", "
\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "Anaconda is an open-source distribution of Python, designed for scientific computing, data science and machine learning. \n", "
\n", "\n", "
\n", "The anaconda website is \n", "here,\n", "with the download page\n", "here.\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Anaconda itself is a distribution, meaning that is a version of Python with a collection of packages that are curated and maintained together. \n", "\n", "Using a pre-built distribution is useful, as it comes with the packages that you need for data science.\n", "\n", "Anaconda also comes with `conda`, which is a package manager, allowing you to download, install, and manage other packages. \n", "\n", "The anaconda distribution includes all packages that are needed for these tutorials." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "\n", "
\n", "
" ] }, { "cell_type": "markdown", "metadata": { "nbpresent": { "id": "0f4dd046-4020-465c-85f6-3d92ac9fe145" } }, "source": [ "
\n", "Jupyter notebooks are a way to intermix code, outputs and plain text. \n", "They run in a web browser, and connect to a kernel to be able to execute code. \n", "
\n", "\n", "
\n", "The official Jupyter website is available \n", "here.\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that you do not need to download Jupyter separately, as it comes packaged with the Anaconda distribution." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Checking Your Python Version\n", "\n", "You can check which installation of Python you are using, and which version it is.\n", "\n", "Once you have installed anaconda, you should see you are using Python in an anaconda folder. \n", "\n", "The version number that is printed should also be 3.6 or greater. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/opt/anaconda3/bin/python\n", "Python 3.7.4\n" ] } ], "source": [ "# Check the installed version of Python\n", "# Note: these are command-line functions that may not work on windows\n", "!which python\n", "!python --version" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "\n", "
\n", "
" ] }, { "cell_type": "markdown", "metadata": { "nbpresent": { "id": "6576af9c-b0f3-4cbe-9a02-06feaa61d0b0" } }, "source": [ "
\n", "Git is a tool, a software package, for version control. \n", "
\n", "\n", "
\n", "Install \n", "git,\n", "if you don't already have it.\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "\n", "
\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "Github is an online hosting service that can be used with git, and offers online tools to use git. \n", "
\n", "\n", "
\n", "Create an account on \n", "Github.\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Git & GitHub are not the same thing, though, in practice, they are commonly used together, whereby git is used as a tool to version control code and manage multiple copies stored across your computer, as well as on remote repositories that are stored on Github.\n", "\n", "Note that while GitHub is a private company, git is an open-source tool, and can be used independent of GitHub." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "git version 2.20.1 (Apple Git-117)\r\n" ] } ], "source": [ "# Check that you have git installed (which version doesn't really matter)\n", "!git --version" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "\n", "
\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "Source Tree is a free graphical user interface (GUI) for managing repositories with git & Github. \n", "
\n", "\n", "
\n", "Source Tree is available \n", "here.\n", "You will need an account on \n", "Atlassian,\n", "who make Source Tree, but this is free.\n", "
\n", "\n", "You don't need to use SourceTree (or any other GUI) if you know, or want to learn to use git from the command line." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Environments" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "Environments are isolated, independent installations of a programming language and groups of packages, that don't interfere with each other. \n", "
\n", "\n", "
\n", "Anaconda has detailed instructions on using environments available \n", "here.\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You do not need to use environments, however you may find it useful if you want or need to maintain multiple different versions of Python. \n", "\n", "If you want to use an environment, and already have conda, you can run this command from command line:
\n", "\n", "``$ conda create --name *envname* python=3.7 anaconda``
\n", "\n", "^ Replace '*envname*' with a name to call this environment.
\n", "\n", "This will install a new environment, with Python 3.7 and the anaconda distribution.\n", "\n", "You will then need to activate this environment (everytime) you want to use it. \n", "\n", "To activate your environment:
\n", "``$ conda activate *envname*``\n", "\n", "To deactivate your environment:
\n", "``$ conda deactivate``" ] } ], "metadata": { "anaconda-cloud": {}, "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.7.4" }, "nbpresent": { "slides": { "3d09dc46-88c8-44cb-bc57-259db78a0e70": { "id": "3d09dc46-88c8-44cb-bc57-259db78a0e70", "prev": "8d1b5def-2290-42c9-8b06-1c6e0e495521", "regions": { "4601423d-c94d-46da-885b-fe33b0216c22": { "attrs": { "height": 1, "width": 1, "x": 0, "y": 0 }, "content": { "cell": "0f4dd046-4020-465c-85f6-3d92ac9fe145", "part": "whole" }, "id": "4601423d-c94d-46da-885b-fe33b0216c22" } } }, "8d1b5def-2290-42c9-8b06-1c6e0e495521": { "id": "8d1b5def-2290-42c9-8b06-1c6e0e495521", "prev": "bc666852-d015-42a1-b679-eaf92d5eb643", "regions": { "d0118c2f-7757-4efa-a276-96f162d312ae": { "attrs": { "height": 1, "width": 1, "x": 0, "y": 0 }, "content": { "cell": "d9d878d6-230b-4f1e-b2aa-2f152cb3fe8e", "part": "whole" }, "id": "d0118c2f-7757-4efa-a276-96f162d312ae" } } }, "b039dd05-8357-462a-9525-7f8103de436c": { "id": "b039dd05-8357-462a-9525-7f8103de436c", "prev": "3d09dc46-88c8-44cb-bc57-259db78a0e70", "regions": { "9180ab3f-f784-45a2-b2cc-a18aad800fc5": { "attrs": { "height": 1, "width": 1, "x": 0, "y": 0 }, "content": { "cell": "b57ed03a-8c01-4e48-95e8-9c6753e35088", "part": "whole" }, "id": "9180ab3f-f784-45a2-b2cc-a18aad800fc5" } } }, "bc666852-d015-42a1-b679-eaf92d5eb643": { "id": "bc666852-d015-42a1-b679-eaf92d5eb643", "layout": "grid", "prev": null, "regions": { "31cd776f-cc93-49d6-a40c-c590805cfb8f": { "attrs": { "height": 0.8333333333333334, "pad": 0.01, "width": 0.8333333333333334, "x": 0.08333333333333333, "y": 0.08333333333333333 }, "content": { "cell": "7fc0cefe-8b1c-4ca9-aa39-094614969842", "part": "whole" }, "id": "31cd776f-cc93-49d6-a40c-c590805cfb8f" }, "e1612c29-0f61-4692-9d6e-112e8d378e46": { "attrs": { "height": 0.8333333333333334, "pad": 0.01, "width": 0.8333333333333334, "x": 0.08333333333333333, "y": 0.08333333333333333 }, "content": { "cell": "7fc0cefe-8b1c-4ca9-aa39-094614969842", "part": "whole" }, "id": "e1612c29-0f61-4692-9d6e-112e8d378e46" } } } }, "themes": {} } }, "nbformat": 4, "nbformat_minor": 1 }