Get started with Python for data analytics
We assume no prior programming experience and that you want to get productive as quickly as possible.
Your machine must have the following:
- Python 3.10 or higher
- VS Code
- VS Code Extension: Python
- Git (configured)
Remember:
- Spacing, Spelling, Capitalization: With computers, these are critical. Always double-check!
In VS Code, open a terminal window (View / Terminal).
If macOS/Linux, change python
to python3
in the commands below.
git --version
python --version
python -m pip install --upgrade pip wheel
With your repo folder open in VS Code:
- Click util_about.py.
- If VS Code prompts, install the recommended Python extension.
- Check the Python Interpreter: On the bottom-left status bar, you might see a version of Python indicated (e.g., Python 3.10.x).
- If not, click on the bottom status bar where it should show the Python version or might say "Select Python Interpreter".
- From the dropdown, choose your default Python version.
- In VS Code, open a terminal window (View / Terminal).
- If macOS/Linux, change
python
topython3
below.
python util_about.py
With your repo folder open in VS Code, start exploring. Open, read, and run each project script (each file will have a .py extension) in order. You don't need to fully understand the code yet. Instead, try to figure out what each file is doing.
- Open acquainted.py (or another .py file).
- Read the comments and code carefully.
- Execute each script - one at a time.
- On macOS/Linux, change
python
topython3
in the commands below.
python acquainted.py
python basic_expressions.py
python basic_functions.py
python circle_calc.py
python data_io.py
python easy_stats.py
Helpful hint: Hit the up arrow in the terminal to get the last command. Edit as needed and hit return.
Read each script in alphabetical order.
- Each project script has a .py file extension.
- In the Explorer, click each script to open it in the editor.
- Read the script.
- You do NOT need to fully understand the code.
- Instead, see which parts you can figure out.
- By the end of the course, these will be very familiar.
Try the TODOs
- When you see a TODO comment, try to do what it suggests.
- Treat these as mini puzzles. Creating small syntax errors and fixing them are a great way to learn.
- Want to see them all? In VS Code, use Edit / Find in Files and search for "TODO".
- Want an extension to make it more fun? Try TODO Tree.
Customize these project scripts.
- Edit the author to your name.
- Add / remove comments as you like.
- Try new things!
- Always run the scripts after making changes. Fix errors as they arise.
If things still work - sync the code back up to GitHub where it's safe.
- On the VS Code side panel, click the source control icon (look for a blue bubble with an number in it).
- Hint: Mouse over the icons to see their names.
- Important! Above the Commit button, it will say "Message".
- You MUST include a commit message.
- In the commit message input box, type "first TODO".
- Click the down arrow on the blue "Commit" button to "Commit and Push" to your GitHub repo.
Verify: Open a browser to your GitHub repo and verify the files have appeared. In addition to the original files, you should have one or more new files. If not, return to VS Code and edit/execute files as needed. Then commit and push again.
Common Issue: If your computer hangs because you forgot the commit message, just enter your message in the top line of the file it shows in the editor. Then click the checkmark in the upper right to close that file and save your commit message. "Sync your changes" to push to GitHub.
Edit this README.md file as you progress. It uses Markdown, a simple and easy markup language.
- Keep the prerequisites and task headings.
- Within the task headings, keep only the commands that worked on YOUR machine.
- Remove unnecessary instructions once you've mastered them.
- Add any additional notes that will help you in the future.
- Overview Programming Languages in VS Code
- Deep Dive Python in VS Code