Community Data Science Workshops (Core)/Day 0 Setup and tutorial: Difference between revisions

From CommunityData
No edit summary
 
(44 intermediate revisions by 10 users not shown)
Line 1: Line 1:
Welcome to the first Friday evening setup session for [[Community_Data_Science_Workshops]]!
{{Template:CDSW Header}}
 
Welcome to the first Friday evening setup session for the [[Community_Data_Science_Workshops |Community Data Science Workshop Winter 2020]]!


When you get to UW and get setup, please do the following things:
When you get to UW and get setup, please do the following things:
Line 5: Line 7:
* Start your laptop and get on the wireless network.
* Start your laptop and get on the wireless network.
* Work through the goals on this page in order. It should take between 2 and 3 hours. Lots of mentors will be around to help troubleshoot and to answer questions — don't hesitate to ask!
* Work through the goals on this page in order. It should take between 2 and 3 hours. Lots of mentors will be around to help troubleshoot and to answer questions — don't hesitate to ask!
* When you've finished all of the setup goals, raise your hand and a helper will come over and go through a checklist with you to make sure you're all set for tomorrow.
* When you've finished all of the setup goals, raise your hand and a mentor will come over and go through a checklist with you to make sure you're all set for tomorrow.


'''Please be sure to do the checkoff before you leave''' — it'll make sure that you are in good shape for tomorrow.
'''Please be sure to do the checkoff before you leave''' — it'll make sure that you are in good shape for tomorrow.
Line 13: Line 15:
If you already have a UW NetID of your own, you should be all set with the network.
If you already have a UW NetID of your own, you should be all set with the network.


If you are not from UW, you will have to use a temporary shared NetID which we have created for the conference. We'll write the username and password up on whiteboard in each of the rooms we are using. Also, make sure you agree with the [http://uw.edu/itconnect/work/appropriate-use/ UW's policy on the ethical use of computers and networks].
If you are not from UW, you will have to use a temporary shared NetID which we have created for the conference and which we will have written on the whiteboards/blackboard in each rooms. We'll write the username and password up on whiteboard in each of the rooms we are using. Also, make sure you agree with the [http://uw.edu/itconnect/work/appropriate-use/ UW's policy on the ethical use of computers and networks].


== Goal #1: Set up Python ==
== Goal #1: Set up Python and make a folder for CDSW files ==


(Estimated time: 5 minutes)
(Estimated time: 5 minutes...if it takes more than 10 minutes, check in with a mentor to see if it's still installing properly)


First things first: We need to install the Python programming language. Please complete the instructions below for your operating system:
First things first: We need to install an environment for working with the Python programming language. Please complete the instructions below for your operating system:


* [[Windows set up Python (Anaconda)|Windows]]  
* [[Windows set up Python (Anaconda)|Windows]]  
* [[OSX set up Python (Anaconda)|OS X]]
* [[OSX set up Python (Anaconda)|OS X]]


'''Note:''' If you are running Windows XP or GNU/Linux, get in contact a mentor for help!
'''Note:''' If you are running GNU/Linux or another operating system, please contact a mentor for help!
 
== Goal #2: Prepare a text editor ==
 
(Estimated time: 5 minutes)
 
In addition to being able to run Python, we are going to install a good text editor for writing and saving Python code during the workshop.<br />
 
If you would like to use a different text editor from the recommendation for your operating system, please let a mentor know.
 
* [[Windows text editor|Windows]]
* [[OSX text editor|OS X]]
 
== Goal #3: Practice starting and exiting Python ==
 
(Estimated time: 5 minutes)
 
We'll do a lot of learning and practicing at a Python "prompt." You will be typing code and hitting enter to get Python to do something. When Python is waiting for us to type code to do something, we call that "interactive."  Later, we'll get Python to run code from a file. For now,  let's practice starting and exiting Python:
 
* [[Windows interactive Python|Windows]]
* [[OSX interactive Python|OS X]]
 
== Goal #4: Practice navigating the computer from a terminal ==
 
(Estimated time: 10 - 15 minutes)
 
Throughout this workshop, we'll be running Python programs from the terminal, which means we'll want to be comfortable with navigating to those programs from the terminal prompt. In this section, we'll practice using these terminal navigation commands.


* [[Windows terminal navigation|Windows]]
* Go ahead and make a folder to use for your CDSW files. A dedicated folder will help you keep track of all the items you download or write as part of the workshop, and make them easier to find later. One of the secrets of data science is being kind to your future self by being extremely organized.
* [[OSX terminal navigation|OS X]]


== Goal #5: Practice running Python code from a file ==
== Goal #2: Practice running Python code from an existing Jupyter notebook ==


(Estimated time: 5 minutes)
(Estimated time: 5 minutes)


Interactive Python programming at a Python prompt is great for short pieces of code and for testing ideas. For longer code, it can be easier to save the code in a file, and execute the contents of that file (aka a Python script). In this section, we'll practice running Python scripts.
We're going to use Jupyter notebooks to write and run Python throughout the workshop. By installing Anaconda, you can now use your computer's web browser to write and run python code files on your computer. Jupyter notebooks can mix together text and code. You can make changes and immediately see what happens. In this section of the setup process, we'll try out your Python setup by running code in an existing notebook.
<div style="font-size:125%">[[Python in Jupyter |  &raquo; Click here to get started with Python in Jupyter &laquo;]]</div>


* [[Windows Python scripts|Windows]]
== Goal #3: Download the Saturday projects ==
* [[OSX Python scripts|OS X]]
 
== Goal #6: Download the Saturday projects ==


(Estimated time: 10 minutes)
(Estimated time: 10 minutes)


In advance of tomorrow's lecture and afternoon projects, go ahead and download the necessary files ahead of time.
In advance of tomorrow's lecture and afternoon projects, please download the necessary files.


<font size="+1">[[CDSW/Day_1_baby_names_project_download|&raquo; Click here and follow the instructions to download the Baby Names project. &laquo;]]</font>
<font size="+1">[[CDSW/Day_1_baby_names_project_download|&raquo; Click here and follow the instructions to download the Baby Names project. &laquo;]]</font>


== Goal #7: Start learning Python! ==
== Goal #4: Start learning Python! ==


(Estimated time: 60 - 90 minutes)
(Estimated time: 60 - 90 minutes)
Line 81: Line 54:
<br />
<br />


== Goal #8: Practice Python using Codecademy ==
== Goal #5: Practice Python using LearnPython ==


(Estimated time: 30 - 60 minutes)
(Estimated time: 30 - 60 minutes)
Line 87: Line 60:
It's time to use what we've learned in the tutorial and get some practice thinking about and solving problems in Python.
It's time to use what we've learned in the tutorial and get some practice thinking about and solving problems in Python.


To give you this practice, we've created custom online practice problems just for this class, using a site called Codecademy!
<div style="font-size:125%">[https://learnpython.org/ &raquo; Click here and complete the first two lessons on Learnpython &laquo;]</div>


Tonight, please visit the link below and complete the '''8 practice problems in the "Strings and choices" section'''. '''Go ahead and skip problem #4 ("Make HTML")'''. It's not a problem if you do it but we find that it's confusing and we'd prefer to skip it this time.
Your next task is to work through '''the first two lessons''' (there are ''many'' lessons, so don't just keep hit "Next" or you're never finish!):


<div style="font-size:125%">[http://www.codecademy.com/courses/python-beginner-en-kSQwt &raquo; Click here and complete tonight's Codecademy exercises &laquo;]</div>
* [https://www.learnpython.org/en/Hello%2C_World%21 Hello, World]
* [https://www.learnpython.org/en/Variables_and_Types Variables and Types]


You don't have to create a Codecademy account to do the exercises, but if you do create an account it'll keep track of which problems you've completed and other statistics.
<!-- If you feel adventurous, go ahead and learn about lists -- they'll be really useful later! -->


== Goal #9: Checkoff ==
You may find the LearnPython interface is different from your Jupyter Notebook. No worries, it's still Python, even though it looks a bit different. You could do these lessons in Jupyter Notebook by copying & pasting the code in the left-hand boxes from LearnPython into Jupyter Notebook cells and run them from Jupyter.
 
== Goal #6: Checkoff ==


Wave down a mentor when you're ready to check out for the evening. Together you will go through the following check-off steps:
Wave down a mentor when you're ready to check out for the evening. Together you will go through the following check-off steps:


* Start a terminal prompt, and from that prompt start Python. Then exit Python.
* Show off your dedicated folder of CDSW files.
* Create a new Python file (with a .py extension). In that file, type: <code>print("Hello World")</code> and then Enter and save the file. From a terminal prompt, navigate to and execute that Python script.
* Start Jupyter and make sure the home page loads.
* Open your text editor, and press "Tab". Use the left arrow key to show the instructor that you are using spaces to indent, not tabs.
* Navigate to the desktop (in Jupyter!) and create a new Jupyter notebook.
* To test the baby names project installation: navigate to the babynames directory and run <code>babynames1.py</code>:
* In that notebook, type: <code>print("Hello World")</code> and then Shift-Enter to run the command.
 
* To test the baby names project installation: navigate to the babynames directory, load the notebook called "BabyNames.ipynb" and run the first cell. If you get no output, then you have done it correctly!
<pre>
* Walk through the LearnPython exercise that you had the most difficulty with.
python babynames1.py
* Exit out of Jupyter (by ending the processes via Control + C in Terminal or PowerShell, then hit 'y' and 'enter', within 5 seconds)
</pre>
* Tell your mentor if there any topics you'd like to learn more about or projects you have in mind. We're going to compare notes after this setup session and would find this information helpful.
 
* Walk through the Codecademy problem that you had the most difficulty with. The Friday Codecademy questions are [http://www.codecademy.com/courses/python-beginner-en-kSQwt here].


If you have any other questions about the tutorial, project setup, or Codecademy questions, now is a great time to ask!
If you have any other questions about the tutorial, project setup, or learnpython, now is a great time to ask!


==Congratulations!==
==Congratulations!==


You are done with the Friday portion of this Workshop. We'll see you at '''9:45am''' tomorrow back here.
You are done with the Friday portion of this Workshop. We'll see you at '''9:45am''' tomorrow.


'''DO NOT BE LATE''': you don't want to miss the beginning of the interactive lecture!
'''DO NOT BE LATE''': you don't want to miss the beginning of the interactive lecture!


If you have any questions, comments, or feedback on tonight's material, don't hesitate to let a staff member know.
If you have any questions, comments, or feedback on tonight's material, don't hesitate to let a mentor know.


[[File:Champagne.png|100px]][[File:Party.png|125px]]
[[File:Champagne.png|100px]][[File:Party.png|125px]]


[[Category:Shared_Pages]]
[[Category:Shared_Pages]]
[[Category:CDSW]]

Latest revision as of 01:01, 16 February 2020

Welcome to the first Friday evening setup session for the Community Data Science Workshop Winter 2020!

When you get to UW and get setup, please do the following things:

  • Start your laptop and get on the wireless network.
  • Work through the goals on this page in order. It should take between 2 and 3 hours. Lots of mentors will be around to help troubleshoot and to answer questions — don't hesitate to ask!
  • When you've finished all of the setup goals, raise your hand and a mentor will come over and go through a checklist with you to make sure you're all set for tomorrow.

Please be sure to do the checkoff before you leave — it'll make sure that you are in good shape for tomorrow.

Goal #0: Connect to the UW Wireless[edit]

If you already have a UW NetID of your own, you should be all set with the network.

If you are not from UW, you will have to use a temporary shared NetID which we have created for the conference and which we will have written on the whiteboards/blackboard in each rooms. We'll write the username and password up on whiteboard in each of the rooms we are using. Also, make sure you agree with the UW's policy on the ethical use of computers and networks.

Goal #1: Set up Python and make a folder for CDSW files[edit]

(Estimated time: 5 minutes...if it takes more than 10 minutes, check in with a mentor to see if it's still installing properly)

First things first: We need to install an environment for working with the Python programming language. Please complete the instructions below for your operating system:

Note: If you are running GNU/Linux or another operating system, please contact a mentor for help!

  • Go ahead and make a folder to use for your CDSW files. A dedicated folder will help you keep track of all the items you download or write as part of the workshop, and make them easier to find later. One of the secrets of data science is being kind to your future self by being extremely organized.

Goal #2: Practice running Python code from an existing Jupyter notebook[edit]

(Estimated time: 5 minutes)

We're going to use Jupyter notebooks to write and run Python throughout the workshop. By installing Anaconda, you can now use your computer's web browser to write and run python code files on your computer. Jupyter notebooks can mix together text and code. You can make changes and immediately see what happens. In this section of the setup process, we'll try out your Python setup by running code in an existing notebook.

Goal #3: Download the Saturday projects[edit]

(Estimated time: 10 minutes)

In advance of tomorrow's lecture and afternoon projects, please download the necessary files.

» Click here and follow the instructions to download the Baby Names project. «

Goal #4: Start learning Python![edit]

(Estimated time: 60 - 90 minutes)

It's time to start learning, reading, and writing some Python! Tonight, you'll work through a self-directed tutorial. Saturday morning, we'll have an interactive lecture to cover more Python basics.


Goal #5: Practice Python using LearnPython[edit]

(Estimated time: 30 - 60 minutes)

It's time to use what we've learned in the tutorial and get some practice thinking about and solving problems in Python.

Your next task is to work through the first two lessons (there are many lessons, so don't just keep hit "Next" or you're never finish!):


You may find the LearnPython interface is different from your Jupyter Notebook. No worries, it's still Python, even though it looks a bit different. You could do these lessons in Jupyter Notebook by copying & pasting the code in the left-hand boxes from LearnPython into Jupyter Notebook cells and run them from Jupyter.

Goal #6: Checkoff[edit]

Wave down a mentor when you're ready to check out for the evening. Together you will go through the following check-off steps:

  • Show off your dedicated folder of CDSW files.
  • Start Jupyter and make sure the home page loads.
  • Navigate to the desktop (in Jupyter!) and create a new Jupyter notebook.
  • In that notebook, type: print("Hello World") and then Shift-Enter to run the command.
  • To test the baby names project installation: navigate to the babynames directory, load the notebook called "BabyNames.ipynb" and run the first cell. If you get no output, then you have done it correctly!
  • Walk through the LearnPython exercise that you had the most difficulty with.
  • Exit out of Jupyter (by ending the processes via Control + C in Terminal or PowerShell, then hit 'y' and 'enter', within 5 seconds)
  • Tell your mentor if there any topics you'd like to learn more about or projects you have in mind. We're going to compare notes after this setup session and would find this information helpful.

If you have any other questions about the tutorial, project setup, or learnpython, now is a great time to ask!

Congratulations![edit]

You are done with the Friday portion of this Workshop. We'll see you at 9:45am tomorrow.

DO NOT BE LATE: you don't want to miss the beginning of the interactive lecture!

If you have any questions, comments, or feedback on tonight's material, don't hesitate to let a mentor know.

Champagne.pngParty.png