Intro to Programming and Data Science (Summer 2020)/Day 1 Coding Challenge: Difference between revisions

From CommunityData
No edit summary
Line 1: Line 1:
Our goal is to get your computer set up with the software you will need for this course and to get started with some basic programming concepts.
Our goal is to get your computer set up with the software you will need for this course and to get started with some basic programming concepts.


* Start your laptop and get on the wireless network.
* Work through the goals on this page in order; they should take around 2 hours. I will help troubleshoot and answer questions — don't hesitate to ask!
* Work through the goals on this page in order; they should take around 2 hours. I will help troubleshoot and answer questions — don't hesitate to ask!
* When you've finished all of the goals, raise your hand and I will come over and go through the checklist with you to make sure everything is working.


== Goal #1: Set up Python ==
== Goal #1: Set up Python and make a class folder ==


(Estimated time: 5 minutes)
(Estimated time: 5 minutes)
Line 14: Line 12:
* [[OSX set up Python (Anaconda)|OS X]]
* [[OSX set up Python (Anaconda)|OS X]]


== Goal #2: Get a text editor ==
* Go ahead and make a folder to use for your class files. A dedicated folder will help you keep track of all the items you download or write as part of the class, 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.


(Estimated time: 5 minutes)
== Goal #2: Practice running Python code from an existing Jupyter notebook ==
 
It is pretty rare for non-programmers to edit plain text files directly and so Notepad (for Windows) or TextEdit (for Mac) is likely all that you've ever used or needed.
 
Because programmers work with text files all day, they have built many, many text editors and have [https://en.wikipedia.org/wiki/Editor_war very strong feelings] about the merits of their preferred editor and the weaknesses of competitors.
 
I am not immune from this human failing, and I'm happy to talk at length about [https://en.wikipedia.org/wiki/Vim_(text_editor) my preferred editor]. However, in this course I will use a simpler editor called [https://atom.io/ Atom], which is free and open source. I highly recommend that you also use Atom. If you want to use something else, then talk to me about it.
 
For this goal, go to [https://atom.io/ the Atom site] and download and install it.
 
== Goal #3: Practice starting and exiting Python ==
 
(Estimated time: 5 minutes)
 
We'll do a lot of learning and practicing at a Python prompt (this is "interactive" because you are typing the code and hitting enter to run it yourself, instead of running it from a file). So 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)
 
In addition to interactively running code, we'll also be writing whole programs and running them from the terminal. This means we'll want to be comfortable with navigating to those programs from the terminal prompt. In this section, we'll practice using these navigation commands.
 
* [[Windows terminal navigation|Windows]]
* [[OSX terminal navigation|OS X]]
 
== Goal #5: Practice running Python code from a file ==


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


Now that you know how to get to a file in the terminal, in this section, we'll practice running Python scripts.
We're going to use Jupyter notebooks to write and run Python throughout the class.  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]]
* [[OSX Python scripts|OS X]]


== Goal #6: Start learning Python! ==
== Goal #3: Start learning Python! ==


(Estimated time: 60 - 90 minutes)
(Estimated time: 60 - 90 minutes)
Line 61: Line 30:
[[Intro To Programming and Data Science (Spring 2020)/Day 1 Tutorial|Day 1 Tutorial]]
[[Intro To Programming and Data Science (Spring 2020)/Day 1 Tutorial|Day 1 Tutorial]]


== Goal #7: Practice Python using DataCamp ==
== Goal #5: Practice Python using LearnPython ==


(Estimated time: 30 - 60 minutes)
(Estimated time: 30 - 60 minutes)
Line 67: Line 36:
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.


The online code learning site [https://www.datacamp.com/ DataCamp] has been kind enough to make their materials available to our class. You should have received an invitation to our DataCamp class site. This will let you see assignment and work on exercises in DataCamp. If you haven't yet done so, then find the email, create an account, and log in.
<div style="font-size:125%">[https://learnpython.org/ &raquo; Click here and complete the first two lessons on Learnpython &laquo;]</div>
 
For tonight (and the rest of this week), work on the assignment in DataCamp.
 
== Goal #8: Checkoff ==
 
Tell me that you are ready to be checked off. Together we will go through the following check-off steps:


* Start a terminal prompt, and from that prompt start Python. Then quit 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!):
* 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.
* 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.
* Walk through the Tutorial concept that was most confusing for you. The Tutorial is [[Intro To Programming and Data Science (Spring 2020)/Day 1 Tutorial|Day 1 Tutorial]].
* Walk through the DataCamp problem that you had the most difficulty with.


If you have any other questions about the tutorial, project setup, or Datacamp questions, now is a great time to ask!
* [https://www.learnpython.org/en/Hello%2C_World%21 Hello, World]
* [https://www.learnpython.org/en/Variables_and_Types Variables and Types]


==Congratulations!==
<!-- If you feel adventurous, go ahead and learn about lists -- they'll be really useful later! -->


You are done with the first class in this series!
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.

Revision as of 15:23, 15 May 2020

Our goal is to get your computer set up with the software you will need for this course and to get started with some basic programming concepts.

  • Work through the goals on this page in order; they should take around 2 hours. I will help troubleshoot and answer questions — don't hesitate to ask!

Goal #1: Set up Python and make a class folder

(Estimated time: 5 minutes)

First things first: We are going to install "Anaconda". This is a suite of programs for doing data science with Python. It will install the Python programming language, together with a number of other packages that we will be using later in the course, such as pandas and Jupyter. Please complete the instructions below for your operating system:

  • Go ahead and make a folder to use for your class files. A dedicated folder will help you keep track of all the items you download or write as part of the class, 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

(Estimated time: 5 minutes)

We're going to use Jupyter notebooks to write and run Python throughout the class. 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: Start learning Python!

(Estimated time: 60 - 90 minutes)

It's time to start learning, reading, and writing some Python! This is a self-directed tutorial that goes through some of the basic syntax and concepts which we will come back to and explain further over the next few weeks.

Day 1 Tutorial

Goal #5: Practice Python using LearnPython

(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.