From 0ae0cba047564c76a1210f0c4f62ef3b89a8eecf Mon Sep 17 00:00:00 2001 From: Jake Date: Wed, 20 Jun 2018 14:45:53 -0400 Subject: [PATCH 1/2] resolved issues #1, #2, #5, #6, #7, #8, add license/contrib --- CONTRIBUTING.md | 37 +++++++++++++++++++++++++++++++++++++ LICENSE.md | 23 +++++++++++++++++++++++ README.md | 32 +++++++++++++++++++++----------- index.ipynb | 37 ++++++++++++++++++++++++++----------- 4 files changed, 107 insertions(+), 22 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..dd12a2a469 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,37 @@ +# Contributing to Learn.co Curriculum + +We're really exited that you're about to contribute to the [open curriculum](https://learn.co/content-license) on [Learn.co](https://learn.co). If this is your first time contributing, please continue reading to learn how to make the most meaningful and useful impact possible. + +## Raising an Issue to Encourage a Contribution + +If you notice a problem with the curriculum that you believe needs improvement +but you're unable to make the change yourself, you should raise a Github issue +containing a clear description of the problem. Include relevant snippets of +the content and/or screenshots if applicable. Curriculum owners regularly review +issue lists and your issue will be prioritized and addressed as appropriate. + +## Submitting a Pull Request to Suggest an Improvement + +If you see an opportunity for improvement and can make the change yourself go +ahead and use a typical git workflow to make it happen: + +* Fork this curriculum repository +* Make the change on your fork, with descriptive commits in the standard format +* Open a Pull Request against this repo + +A curriculum owner will review your change and approve or comment on it in due +course. + +# Why Contribute? + +Curriculum on Learn is publicly and freely available under Learn's +[Educational Content License](https://learn.co/content-license). By +embracing an open-source contribution model, our goal is for the curriculum +on Learn to become, in time, the best educational content the world has +ever seen. + +We need help from the community of Learners to maintain and improve the +educational content. Everything from fixing typos, to correcting +out-dated information, to improving exposition, to adding better examples, +to fixing tests—all contributions to making the curriculum more effective are +welcome. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000000..a297d511e1 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,23 @@ +# Learn.co Educational Content License + +Copyright (c) 2018 Flatiron School, Inc + +The Flatiron School, Inc. owns this Educational Content. However, the Flatiron +School supports the development and availability of educational materials in +the public domain. Therefore, the Flatiron School grants Users of the Flatiron +Educational Content set forth in this repository certain rights to reuse, build +upon and share such Educational Content subject to the terms of the Educational +Content License set forth [here](http://learn.co/content-license) +(http://learn.co/content-license). You must read carefully the terms and +conditions contained in the Educational Content License as such terms govern +access to and use of the Educational Content. + +Flatiron School is willing to allow you access to and use of the Educational +Content only on the condition that you accept all of the terms and conditions +contained in the Educational Content License set forth +[here](http://learn.co/content-license) (http://learn.co/content-license). By +accessing and/or using the Educational Content, you are agreeing to all of the +terms and conditions contained in the Educational Content License. If you do +not agree to any or all of the terms of the Educational Content License, you +are prohibited from accessing, reviewing or using in any way the Educational +Content. diff --git a/README.md b/README.md index 09d0e2145a..94f7d26194 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ### Introduction -So far, many of the readings and all of the labs you have been working with have been interactive. You are working in an environment that allows us to both display text, and run Python code. In this lesson, we explore Jupyter, the software powering these interactive documents. +So far, many of the readings and all of the labs you have been working with have been interactive. You are working in an environment that allows us to both display text and run Python code. In this lesson, we explore Jupyter, the software powering these interactive documents. ### Jupyter Background @@ -27,15 +27,19 @@ If we wish to quickly add a new cell we can do so with the following steps: * Make sure we are not in insert mode, but in escape mode * *Remember we can tell we are in insert mode when we have a green border around our cell.* - * To get out of insert mode and into escape mode, press the escape key. + * To get out of insert mode and into escape mode, press shift + enter. Another option is to press the escape key. * You will no longer see a cell bordered in green. -* Then press the letter `b` +* Then press the letter `b` to create a new cell. #### Deleting cells To delete a cell we once again should be in escape mode, and then press the `x` key. -Of course, we'll want a way to undo our deletion. You can press d to undo deletion of a cell. Note that this is different from `cmd + z`. Pressing `cmd + z` undoes our changes inside of a cell, but pressing `d` from escape mode is to undo changing a cell in it's entirety. +Of course, we'll want a way to undo our deletion. From escape mode, you can press `z` to undo deletion of a cell. Note that this is different from `cmd + z`. Pressing `cmd + z` while in insert mode undoes any changes inside of a cell while, whether these changes be deletions or text insertions. Pressing `z` from escape mode undoes the deletion a cell. + +Go to escape mode and press `x`. This cell disappears! + +Then bring it back with `z`. ### Types of Cells @@ -45,25 +49,31 @@ Cells can also have a type of code. If we are writing in a cell that is for Pyt ```python -This is a python cell without valid Python so we wil see an error +This is a python cell without valid Python so we will see an error ``` So, a cell must either be of type markdown or of type code, in which case all of the contents must be valid Python. It cannot be both. We can quickly change a cell from markdown to code with some keyboard shortcuts. -From escape mode, we change a cell to type code by pressing the letter `y`. Add a new cell by pressing the letter `b`, then type `j` to change that cell into type code. Again, press `shift + enter` to save the changes of the cell. From escape mode, press the letter `m` to change the cell from code to markdown. +From escape mode, we change a cell to type code by pressing the letter `y`. + +Anytime we create a new cell, say with the shortcut key `b`, the new cell will default to code mode. We can switch to escape mode and press the letter `m` to change the cell from code to markdown. + +#### View All Shortcuts + +Press the key `h` while in escape mode to view the menu for all of Jupyter's shortcuts. ### Working with Python in Jupyter Ok, now that we know a little bit about adding and deleting cells, as well as changing cell types from markdown to code, let's focus on working with Python in Jupyter. We'll go into a large amount of detail about working with a Jupyter notebook in Python, but the main takeaway is this: if we see a Python cell, we should press `shift + enter` on that cell. -The major gotcha in working with Python code is that Python will only execute the cells that are run. So for example, just seeing the cell where we define `name` to `'bob'` below does not write that cell to memory. +The major gotcha in working with Python code is that we must execute the cells in order for Python to register the code in them. So for example, just seeing the cell where we define `name` to `'bob'` below does not write that cell to memory. ```python name = 'bob' ``` -If we try to reference that variable later on withouth having run it, Python will tell us that it is not defined. +If we try to reference that variable later on without having executed the cell, Python will tell us that it is not defined. ```python @@ -75,7 +85,7 @@ name NameError Traceback (most recent call last) - in () + in () ----> 1 name @@ -99,7 +109,7 @@ age As you can see the variable `age` is set to 14, so when the cell is run `14` is displayed underneath. -One tricky thing to note is that assignment, the action of assigning a varible, **does not** have a return a value. So, even though the cell is run, if the last line of cell is the assigning of a variable, nothing is displayed underneath. +One tricky thing to note is that assignment, the action of assigning a variable, **does not** have a return a value. So, even though the cell is run, if the last line of cell is the assigning of a variable, nothing is displayed underneath. ```python @@ -135,6 +145,6 @@ The same thing goes for working through a Readme. The Readmes will often assign ### Summary -In this lesson, we learned about Jupyter notebooks. We saw that in Jupyter notebooks, we can either be in insert mode or escape mode. While in insert mode, we can edit the cells and undo changes within that cell with `command + z` or `ctl + z`. In escape mode, we can add cells with `b`, delete a cell with `x`, and undo deletion of a cell with `d`. We can also change the type of a cell to markdown with `m` and to Python code with `j`. +In this lesson, we learned about Jupyter notebooks. We saw that in Jupyter notebooks, we can either be in insert mode or escape mode. While in insert mode, we can edit the cells and undo changes within that cell with `cmd + z` on a mac or `ctl + z` on windows. In escape mode, we can add cells with `b`, delete a cell with `x`, and undo deletion of a cell with `z`. We can also change the type of a cell to markdown with `m` and to Python code with `y`. Then we saw how to work with Python code in Jupyter notebooks. We saw that to have our code in a cell executed, we need to press `shift + enter`. If we do not do this, then our variables that we assigned in Python are not going to be recognized by Python later on in our Jupyter notebook. diff --git a/index.ipynb b/index.ipynb index f20c51e1c9..db0e8e3362 100644 --- a/index.ipynb +++ b/index.ipynb @@ -18,7 +18,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "So far, many of the readings and all of the labs you have been working with have been interactive. You are working in an environment that allows us to both display text, and run Python code. In this lesson, we explore Jupyter, the software powering these interactive documents." + "So far, many of the readings and all of the labs you have been working with have been interactive. You are working in an environment that allows us to both display text and run Python code. In this lesson, we explore Jupyter, the software powering these interactive documents." ] }, { @@ -100,7 +100,11 @@ "source": [ "To delete a cell we once again should be in escape mode, and then press the `x` key.\n", "\n", - "Of course, we'll want a way to undo our deletion. From escape mode, you can press z to undo deletion of a cell. Note that this is different from `cmd + z`. Pressing `cmd + z` undoes our changes inside of a cell, but pressing `d` from escape mode is to undo changing a cell in it's entirety." + "Of course, we'll want a way to undo our deletion. From escape mode, you can press `z` to undo deletion of a cell. Note that this is different from `cmd + z`. Pressing `cmd + z` while in insert mode undoes any changes inside of a cell while, whether these changes be deletions or text insertions. Pressing `z` from escape mode undoes the deletion a cell.\n", + "\n", + "Go to escape mode and press `x`. This cell disappears!\n", + "\n", + "Then bring it back with `z`." ] }, { @@ -122,7 +126,7 @@ }, "outputs": [], "source": [ - "This is a python cell without valid Python so we wil see an error" + "This is a python cell without valid Python so we will see an error" ] }, { @@ -133,7 +137,18 @@ "source": [ "So, a cell must either be of type markdown or of type code, in which case all of the contents must be valid Python. It cannot be both. We can quickly change a cell from markdown to code with some keyboard shortcuts.\n", "\n", - "From escape mode, we change a cell to type code by pressing the letter `y`. Add a new cell by pressing the letter `b`, then type `j` to change that cell into type code. Again, press `shift + enter` to save the changes of the cell. From escape mode, press the letter `m` to change the cell from code to markdown." + "From escape mode, we change a cell to type code by pressing the letter `y`.\n", + "\n", + "Anytime we create a new cell, say with the shortcut key `b`, the new cell will default to code mode. We can switch to escape mode and press the letter `m` to change the cell from code to markdown." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### View All Shortcuts\n", + "\n", + "Press the key `h` while in escape mode to view the menu for all of Jupyter's shortcuts." ] }, { @@ -154,7 +169,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The major gotcha in working with Python code is that Python will only execute the cells that are run. So for example, just seeing the cell where we define `name` to `'bob'` below does not write that cell to memory." + "The major gotcha in working with Python code is that we must execute the cells in order for Python to register the code in them. So for example, just seeing the cell where we define `name` to `'bob'` below does not write that cell to memory." ] }, { @@ -172,12 +187,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "If we try to reference that variable later on withouth having run it, Python will tell us that it is not defined. " + "If we try to reference that variable later on without having executed the cell, Python will tell us that it is not defined. " ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -187,7 +202,7 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mname\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mname\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mNameError\u001b[0m: name 'name' is not defined" ] } @@ -230,7 +245,7 @@ "source": [ "As you can see the variable `age` is set to 14, so when the cell is run `14` is displayed underneath.\n", "\n", - "One tricky thing to note is that assignment, the action of assigning a varible, **does not** have a return a value. So, even though the cell is run, if the last line of cell is the assigning of a variable, nothing is displayed underneath. " + "One tricky thing to note is that assignment, the action of assigning a variable, **does not** have a return a value. So, even though the cell is run, if the last line of cell is the assigning of a variable, nothing is displayed underneath. " ] }, { @@ -316,7 +331,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "In this lesson, we learned about Jupyter notebooks. We saw that in Jupyter notebooks, we can either be in insert mode or escape mode. While in insert mode, we can edit the cells and undo changes within that cell with `command + z` or `ctl + z`. In escape mode, we can add cells with `b`, delete a cell with `x`, and undo deletion of a cell with `d`. We can also change the type of a cell to markdown with `m` and to Python code with `j`. \n", + "In this lesson, we learned about Jupyter notebooks. We saw that in Jupyter notebooks, we can either be in insert mode or escape mode. While in insert mode, we can edit the cells and undo changes within that cell with `cmd + z` on a mac or `ctl + z` on windows. In escape mode, we can add cells with `b`, delete a cell with `x`, and undo deletion of a cell with `z`. We can also change the type of a cell to markdown with `m` and to Python code with `y`. \n", "\n", "Then we saw how to work with Python code in Jupyter notebooks. We saw that to have our code in a cell executed, we need to press `shift + enter`. If we do not do this, then our variables that we assigned in Python are not going to be recognized by Python later on in our Jupyter notebook." ] @@ -338,7 +353,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.1" + "version": "3.6.4" } }, "nbformat": 4, From b449b3d70d66af65f76b0603e1d313efab230bb0 Mon Sep 17 00:00:00 2001 From: Lore Dirick Date: Thu, 14 Feb 2019 15:15:23 -0500 Subject: [PATCH 2/2] add in missing word --- README.md | 2 +- index.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 94f7d26194..6bed4b7617 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ If we wish to quickly add a new cell we can do so with the following steps: To delete a cell we once again should be in escape mode, and then press the `x` key. -Of course, we'll want a way to undo our deletion. From escape mode, you can press `z` to undo deletion of a cell. Note that this is different from `cmd + z`. Pressing `cmd + z` while in insert mode undoes any changes inside of a cell while, whether these changes be deletions or text insertions. Pressing `z` from escape mode undoes the deletion a cell. +Of course, we'll want a way to undo our deletion. From escape mode, you can press `z` to undo deletion of a cell. Note that this is different from `cmd + z`. Pressing `cmd + z` while in insert mode undoes any changes inside of a cell while, whether these changes be deletions or text insertions. Pressing `z` from escape mode undoes the deletion of a cell. Go to escape mode and press `x`. This cell disappears! diff --git a/index.ipynb b/index.ipynb index db0e8e3362..9da474b9de 100644 --- a/index.ipynb +++ b/index.ipynb @@ -100,7 +100,7 @@ "source": [ "To delete a cell we once again should be in escape mode, and then press the `x` key.\n", "\n", - "Of course, we'll want a way to undo our deletion. From escape mode, you can press `z` to undo deletion of a cell. Note that this is different from `cmd + z`. Pressing `cmd + z` while in insert mode undoes any changes inside of a cell while, whether these changes be deletions or text insertions. Pressing `z` from escape mode undoes the deletion a cell.\n", + "Of course, we'll want a way to undo our deletion. From escape mode, you can press `z` to undo deletion of a cell. Note that this is different from `cmd + z`. Pressing `cmd + z` while in insert mode undoes any changes inside of a cell while, whether these changes be deletions or text insertions. Pressing `z` from escape mode undoes the deletion of a cell.\n", "\n", "Go to escape mode and press `x`. This cell disappears!\n", "\n",