From 8e434e503e9c515575ba2332296214a832fdf8ee Mon Sep 17 00:00:00 2001 From: Tracy Teal Date: Fri, 28 Apr 2017 13:52:43 -0700 Subject: [PATCH 1/2] updated so challenges appear by default --- assets/js/lesson.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/lesson.js b/assets/js/lesson.js index c51dca649..185da9202 100644 --- a/assets/js/lesson.js +++ b/assets/js/lesson.js @@ -3,7 +3,7 @@ $("table").addClass("table table-striped"); // Handle foldable challenges and solutions (on click and at start). -$(".challenge,.discussion,.solution").click(function(event) { +$(".solution").click(function(event) { var trigger = $(event.target).has(".fold-unfold").size() > 0 || $(event.target).filter(".fold-unfold").size() > 0; if (trigger) { @@ -12,7 +12,7 @@ $(".challenge,.discussion,.solution").click(function(event) { event.stopPropagation(); } }); -$(".challenge,.discussion,.solution").each(function() { +$(".solution").each(function() { $(">*:not(h2)", this).toggle(); var h2 = $("h2:first", this); h2.append(""); From c3125579bc87dab445f3dcb6ddfca5c8a1af6a19 Mon Sep 17 00:00:00 2001 From: Tracy Teal Date: Fri, 28 Apr 2017 14:32:44 -0700 Subject: [PATCH 2/2] updated index and setup --- index.md | 108 +++++++++++++------------------------------------------ setup.md | 34 ++++++++++++------ 2 files changed, 47 insertions(+), 95 deletions(-) diff --git a/index.md b/index.md index 0891be595..c3ec757c2 100644 --- a/index.md +++ b/index.md @@ -2,95 +2,35 @@ layout: lesson root: . -contributors: - - April Wright - - Ethan White - - John Gosset - - Leah Wasser - - Mariela Perignon - - Tracy Teal - maintainers: - April Wright - John Gosset - Mateusz Kuzak - -software: Python --- -**Content Contributors:** {{ page.contributors | join: ', ' }} - **Lesson Maintainers:** {{ page.maintainers | join: ', ' }} -Data Carpentry's aim is to teach researchers basic concepts, skills, and tools -for working with data so that they can get more done in less time, and with less -pain. The lessons below were designed for those interested in working with -ecological data in Python. - - -## Lessons - -- [Short Introduction to Python](00-short-introduction-to-Python) -- [Starting With Data](01-starting-with-data) -- [Index Slice Subset](02-index-slice-subset) -- [Data Types and Format](03-data-types-and-format) -- [Merging Data](04-merging-data) -- [Data Analysis Automation: Loops and Functions](05-loops-and-functions) -- [Plotting with ggplot](06-visualization-ggplot-python) -- [Putting It All Together](07-putting-it-all-together) -- [Accessing SQL using Python](08-working-with-sql) - - -## Data - -Data for this lesson is from the Portal Project Teaching Database - -[available on FigShare](https://figshare.com/articles/Portal_Project_Teaching_Database/1314459). - -Specifically, the data files we use in these lessons are: - -- [surveys.csv](https://ndownloader.figshare.com/files/2292172) -- [species.csv](https://ndownloader.figshare.com/files/3299483) - - -## Requirements - -Data Carpentry's teaching is hands-on, so participants are encouraged to use -their own computers to insure the proper setup of tools for an efficient workflow. -*These lessons assume no prior knowledge of the skills or tools*, but working -through this lesson requires working copies of the software described below. -To most effectively use these materials, please make sure to install everything -*before* working through this lesson. - -Participants are required to abide by Data Carpentry's -[Code of Conduct](http://www.datacarpentry.org/code-of-conduct/). - - -{% if page.software == "Python" %} -{% include pythonSetup.html %} -{% elsif page.software == "Spreadsheets" %} -{% include spreadsheetSetup.html %} -{% elsif page.software == "R" %} -{% include rSetup.html %} -{% else %} -{% include anySetup.html %} -{% endif %} - - -## Acknowledgements & Support - -Data Carpentry is supported by the [Gordon and Betty Moore Foundation] and a -partnership of several NSF-funded [BIO] Centers ([NESCent], [iPlant], [iDigBio], -[BEACON] and [SESYNC]) and [Software Carpentry], and is sponsored by the [Data -Observation Network for Earth] (DataONE). The structure and objectives of the -curriculum as well as the teaching style are informed by [Software Carpentry]. - - -[Gordon and Betty Moore Foundation]: https://www.moore.org -[BIO]: https://www.nsf.gov/dir/index.jsp?org=BIO -[NESCent]: https://nescent.org -[iPlant]: http://www.iplantcollaborative.org -[iDigBio]: https://www.idigbio.org -[BEACON]: http://beacon-center.org -[SESYNC]: https://sesync.org -[Software Carpentry]: https://software-carpentry.org -[Data Observation Network for Earth]: https://www.dataone.org +Python is a general purpose programming language that is useful for writing scripts to work effectively and reproducibly with data. + +This is an introduction to Python designed for participants with no programming experience. These lessons can be taught in a day (~ 6 hours). They start with some basic information about Python syntax, the Jupyter notebook interface, and move through how to import CSV files, using the pandas package to work with data frames, how to calculate summary information from a data frame, and a brief introduction to plotting. The last lesson demonstrates how to work with databases directly from Python. + +> ## Getting Started +> +> Data Carpentry's teaching is hands-on, so participants are encouraged to use +> their own computers to insure the proper setup of tools for an efficient +> workflow.
**These lessons assume no prior knowledge of the skills or tools.** +> +> To get started, follow the directions in the "[Setup](setup/)" tab to +> download data to your computer and follow any installation instructions. +> +> #### Prerequisites +> +> This lesson requires a working copy of **Python**. +>
To most effectively use these materials, please make sure to install +> everything *before* working through this lesson. +{: .prereq} + +> ## For Instructors +> If you are teaching this lesson in a workshop, please see the +> [Instructor notes](guide/). +{: .prereq} diff --git a/setup.md b/setup.md index 09913370a..a47e0cc34 100644 --- a/setup.md +++ b/setup.md @@ -1,11 +1,23 @@ --- layout: page -title: Setup Instructions for Learners +title: Setup permalink: /setup/ --- -# Python +> ## Data +{: .prereq} +Data for this lesson is from the Portal Project Teaching Database - +[available on FigShare](https://figshare.com/articles/Portal_Project_Teaching_Database/1314459). +For this lesson, we will use two files for the data. Download these files to your computer. Once you click on them they will be automatically downloaded to your default download directory. + +- [surveys.csv](https://ndownloader.figshare.com/files/2292172) +- [species.csv](https://ndownloader.figshare.com/files/3299483) + + + +> ## Software +{: .prereq} [Python](http://python.org) is a popular language for scientific computing, and great for general-purpose programming as well. Installing all of its scientific packages individually can be @@ -80,7 +92,7 @@ wish to use a different browser, open this link: . ## Overview of the Jupyter notebook (Optional) -![Example Jupyter Notebook](./fig/00_0_jupyter_notebook_example.jpg) +![Example Jupyter Notebook](../fig/00_0_jupyter_notebook_example.jpg) *Screenshot of a [Jupyter Notebook on quantum mechanics](https://github.com/jrjohansson/qutip-lectures) by Robert Johansson* ### How the Jupyter notebook works @@ -93,26 +105,26 @@ After typing the command `jupyter notebook`, the following happens: * The Jupyter Notebook server opens the Jupyter notebook client, also known as the notebook user interface, in your default web browser. - ![Jupyter notebook file browser](./fig/00_1_jupyter_file_browser.png) + ![Jupyter notebook file browser](../fig/00_1_jupyter_file_browser.png) *The Jupyter notebook file browser* * To create a new Python notebook select the "New" dropdown on the upper right of the screen. - ![Jupyter notebook file browser](./fig/00_2_jupyter_new_notebook.png) + ![Jupyter notebook file browser](../fig/00_2_jupyter_new_notebook.png) *The Jupyter notebook file browser* * When you can create a new notebook and type code into the browser, the web browser and the Jupyter notebook server communicate with each other. - ![new Jupyter notebook](./fig/00_3_jupyter_blank_notebook.png) + ![new Jupyter notebook](../fig/00_3_jupyter_blank_notebook.png) *A new, blank Jupyter notebook* * Under the "help" menu, take a quick interactive tour of how to use the notebook. Help on Jupyter and key workshop packages is available here too. - ![Jupyter tour and help](./fig/00_4_jupyter_tour_help.png) + ![Jupyter tour and help](../fig/00_4_jupyter_tour_help.png) *User interface tour and Help* * The Jupyter Notebook server does the work and calculations, and the web @@ -121,13 +133,13 @@ After typing the command `jupyter notebook`, the following happens: * For example, click in the first cell and type some Python code. - ![Code cell](./fig/00_5_jupyter_code_before.png) + ![Code cell](../fig/00_5_jupyter_code_before.png) *A Code cell* * This is a **Code** cell (see the cell type dropdown with the word **Code**). To run the cell, type Shift-Enter. - ![Code cell and its output](./fig/00_6_jupyter_code_after.png) + ![Code cell and its output](../fig/00_6_jupyter_code_after.png) *A Code cell and its output* * Let's look at a **Markdown** cell. Markdown is a text manipulation @@ -135,12 +147,12 @@ After typing the command `jupyter notebook`, the following happens: to select **Markdown** from the cell type dropdown. Click in the cell and enter the markdown text. - ![markdown input cell](./fig/00_7_jupyter_markdown_before.png) + ![markdown input cell](../fig/00_7_jupyter_markdown_before.png) *A markdown input cell* * To run the cell, type Shift-Enter. - ![rendered markdown cell](./fig/00_8_jupyter_markdown_after.png) + ![rendered markdown cell](../fig/00_8_jupyter_markdown_after.png) *A rendered markdown cell*