<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://www.python.org/static/img/python-logo.png\">\n",
    "\n",
    "# Welcome to my lessons\n",
    "\n",
    "---\n",
    "\n",
    "**<NAME>** (NAOC, <mailto:<EMAIL>>) will have a few lessons on python.\n",
    "\n",
    "- These are very useful knowledge, skills and code styles when you use `python` to process astronomical data.\n",
    "- All materials can be found on [my github page](https://github.com/hypergravity/cham_teaches_python).\n",
    "- jupyter (ipython notebook) is recommeded to use\n",
    "\n",
    "---\n",
    "These lectures are organized as below:\n",
    "1. install python\n",
    "2. basic syntax\n",
    "3. numerical computing\n",
    "4. plotting\n",
    "5. astronomical data processing\n",
    "6. high performance computing\n",
    "7. version control\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# what is `python`\n",
    "An OOP language started \n",
    "\n",
    "- python.org: [https://www.python.org/](https://www.python.org/)\n",
    " - this is the official web page of `python`\n",
    " ![www.python.org](./stuff01/Screenshot from 2016-06-12 15:26:58.png)\n",
    "- pypi (**PY**thon **P**ackage **I**ndex): [https://pypi.python.org/pypi](https://pypi.python.org/pypi)\n",
    " - from here, you can download almost all `python` packages\n",
    " ![](./stuff01/Screenshot from 2016-06-12 15:16:33.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Advantages\n",
    "1. easy-to-use/understand\n",
    "2. extensions\n",
    "3. astronomical packages\n",
    "4. high performance computing\n",
    "5. open source\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# how to install python\n",
    "type these in your terminal:\n",
    "```\n",
    "$ sudo apt-get install pip\n",
    "$ sudo pip install python\n",
    "```\n",
    "`pip` can install almost all `python` packages.\n",
    "So I recommend you use this to install all packages.\n",
    "\n",
    "An alternative is to use `easy_install`, which is a very similar tool.\n",
    "\n",
    "type `$ python` to enter the python shell\n",
    "![](./stuff01/Screenshot from 2016-06-12 15:37:21.png)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World\n"
     ]
    }
   ],
   "source": [
    "print \"Hello World\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Recommended IDEs (Interactive Development Environments)\n",
    "- spyder / python(x,y) / [anaconda](https://www.continuum.io/why-anaconda)\n",
    " - scientific computing\n",
    " - easy-to-use\n",
    " - ipython backend\n",
    "![](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7e/Spyder_logo.svg/100px-Spyder_logo.svg.png)\n",
    "![](./stuff01/Screenshot from 2016-06-12 15:56:43.png )\n",
    "\n",
    "- [ipython/ipython qtconsole](https://ipython.org/)\n",
    " - shell-like\n",
    " - magic functions\n",
    "![](./stuff01/Screenshot from 2016-06-12 16:13:59.png)\n",
    "![](./stuff01/Screenshot from 2016-06-12 16:15:16.png)\n",
    "\n",
    "- [jupyter (ipython notebook)](http://jupyter.org/)\n",
    " - magic functions\n",
    " - markdown\n",
    " - various format (html, pdf, ...)\n",
    "![](./stuff01/Screenshot from 2016-06-12 16:24:08.png)\n",
    "\n",
    "- [JetBrain (Pycharm)](https://www.jetbrains.com/)\n",
    " - code folding\n",
    " - version control\n",
    " - module test\n",
    " - code reformat\n",
    "![](./stuff01/Screenshot from 2016-06-12 16:26:01.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%magic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%%bash\n",
    "ls -a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },<commit_msg>update Lesson 1<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://www.python.org/static/img/python-logo.png\">\n",
    "\n",
    "# Welcome to my lessons\n",
    "\n",
    "---\n",
    "\n",
    "**<NAME>** (NAOC, <mailto:<EMAIL>>) will have a few lessons on python.\n",
    "\n",
    "- These are very useful knowledge, skills and code styles when you use `python` to process astronomical data.\n",
    "- All materials can be found on [my github page](https://github.com/hypergravity/cham_teaches_python).\n",
    "- jupyter (ipython notebook) is recommeded to use\n",
    "\n",
    "---\n",
    "These lectures are organized as below:\n",
    "1. install python\n",
    "2. basic syntax\n",
    "3. numerical computing\n",
    "4. plotting\n",
    "5. astronomical data processing\n",
    "6. high performance computing\n",
    "7. version control\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# what is `python`\n",
    "An OOP language started \n",
    "\n",
    "- python.org: [https://www.python.org/](https://www.python.org/)\n",
    " - this is the official web page of `python`\n",
    " ![www.python.org](./stuff01/Screenshot from 2016-06-12 15:26:58.png)\n",
    "- pypi (**PY**thon **P**ackage **I**ndex): [https://pypi.python.org/pypi](https://pypi.python.org/pypi)\n",
    " - from here, you can download almost all `python` packages\n",
    " ![](./stuff01/Screenshot from 2016-06-12 15:16:33.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Advantages\n",
    "1. easy-to-use/understand\n",
    "2. extensions\n",
    "3. astronomical packages\n",
    "4. high performance computing\n",
    "5. open source\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# how to install python\n",
    "type these in your terminal:\n",
    "```\n",
    "$ sudo apt-get install pip\n",
    "$ sudo pip install python\n",
    "```\n",
    "`pip` can install almost all `python` packages.\n",
    "So I recommend you use this to install all packages.\n",
    "\n",
    "An alternative is to use `easy_install`, which is a very similar tool.\n",
    "\n",
    "type `$ python` to enter the python shell\n",
    "![](./stuff01/Screenshot from 2016-06-12 15:37:21.png)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World\n"
     ]
    }
   ],
   "source": [
    "print \"Hello World\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Recommended IDEs (Interactive Development Environments)\n",
    "- spyder / python(x,y) / [anaconda](https://www.continuum.io/why-anaconda)\n",
    " - scientific computing\n",
    " - easy-to-use\n",
    " - ipython backend\n",
    "![](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7e/Spyder_logo.svg/100px-Spyder_logo.svg.png)\n",
    "![](./stuff01/Screenshot from 2016-06-12 15:56:43.png )\n",
    "\n",
    "- [ipython/ipython qtconsole](https://ipython.org/)\n",
    " - shell-like\n",
    " - magic functions\n",
    "![](./stuff01/Screenshot from 2016-06-12 16:13:59.png)\n",
    "![](./stuff01/Screenshot from 2016-06-12 16:15:16.png)\n",
    "\n",
    "- [jupyter (ipython notebook)](http://jupyter.org/)\n",
    " - magic functions\n",
    " - markdown\n",
    " - various format (html, pdf, ...)\n",
    "![](./stuff01/Screenshot from 2016-06-12 16:24:08.png)\n",
    "\n",
    "- [JetBrain (Pycharm)](https://www.jetbrains.com/)\n",
    " - code folding\n",
    " - version control\n",
    " - module test\n",
    " - code reformat\n",
    "![](./stuff01/Screenshot from 2016-06-12 16:26:01.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%magic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".\n",
      "..\n",
      "cham_teaches_python_01_install_python.html\n",
      "cham_teaches_python_01_install_python.ipynb\n",
      "cham_teaches_python_02_basic_syntax.html\n",
      "cham_teaches_python_02_basic_syntax.ipynb\n",
      "cham_teaches_python_03_numerical_computing.ipynb\n",
      ".git\n",
      ".ipynb_checkpoints\n",
      "stuff01\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "ls -a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
{'fraction_non_alphanumeric': 0.21588573777229758, 'fraction_numerical': 0.031956432387998356, 'mean_word_length': 2.462468872287442, 'pattern_counts': {'":': 117, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 20, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4544140', 'n_tokens_mistral': 3993, 'n_tokens_neox': 3664, 'n_words': 736}