Last updated 10/26/2017
This site was set up to host workshop content and is meant for students for reference/self-study. It is split into the following sections:
Stay tuned as we add additional sections!
Python is a high-level programming language. It’s a swiss army knife-like tool that is quick to deploy and can be used for all sorts of applications.
Just a quick laundry list of things it can be used it for at work:
Python is FREE. That’s numero uno.
Second, have you ever tried to walk through someone else’s Excel workbook? That’s at best mildly annoying, and at worst, an absolute nightmare. Once you learn them, Python and other text-based languages allow for clean and logical information sharing.
Lastly, Python can do WAY more once you learn how to use it. Once you hit Excel’s limit on rows (~100K records) you’ll need to transition to a more powerful tool, cough Python. Further, unlike Excel/Powerpoint, new functionality is added all the time.
Should you learn R or Python? It doesn’t matter for analytics. Once you learn one you can pick the other up pretty easily. However, Python is broadly a more universal tool that can do more things. If you plan to do stuff outside of analytics, you should learn Python.
Step 1, install Python.
We will use version 2.7. There is a newer 3.X version available, which introduces new functions but most applications use Python 2.7.
You can download Python 2.7 @ https://www.python.org/downloads/release/python-2714/
Scroll down until you hit the ‘Files’ section. If you have Windows, download the Windows x86-64 MSI installer package. If you have a Mac, you have Python installed by default.
First off, you’ll need to know some terminology.
Second, the installation allows your computer to understand Python code and will set you up with a crappy text editor called IDLE. For our purposes here, we’ll use IDLE. The next section will detail out a couple of better ones you can try :)
Lastly, if you ever run into an error, there are a TON of resources on the web for help. Your best bet is to google “what does (insert error message here) mean Python?” and you should find an answer. Feel free to also hit up KDA office hours!
Software editors are often used to write code. They help highlight certain parts of code (SUPER useful), use smart indenting, and basically you should totally be using one and NOT Notepad/Textpad. They also contain super helpful menu commands for changing settings and running code previews.
There are a few out there that you can try:
We highly recommend going through the DataCamp course: Introduction to Python for Data Science to learn the basics of programming and Python. You can find a link to it under the Resources tab up above. It’s super intuitive, does a good job teaching the basics, and gives you a follow along environment in your browser that’s really helpful.
In it, you’ll go over a lot of programming basics that you’ll have to know to use more advanced functions in Python: