Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

dive-into-machine-learning/python-tips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

Learn More Python

Colleagues asked me for some resources so they could learn more Python. So, here you go!

New to Python or coding? Start here. (Updated 2022)

futurecoder.ioalexmojaki/futurecoder

This is a 100% free and interactive course for people to teach themselves programming in Python, especially complete beginners at programming. It is carefully designed to reduce frustration and guide the user while still ensuring that they learn how to solve problems. The goal is for as many people as possible to learn programming.

It runs completely in the browser, no installation required. And it's free. I think this project will help so many people get into Python.

Already know Python?

vinta/awesome-python — Resources


Archived

Where to start (older notes)

If you have not installed Python yet, you need to pick a version of Python and then install. For both of these subjects, you should read Hitchhiker's Guide to PythonUPDATE in 2019: start with Python 3!

It's also a good idea to debunk the myths you may have heard about Python:

As for why to learn it (and ignore the bellyachers who are wasting their time telling you what to learn):

Python community

If nobody’s told you yet, Python’s community is one of the most important things about it :) Join forums, subreddits (/r/Python, /r/learnpython), chats (Slacks or IRCs) local meetups, etc., and get support. You’ll learn much better with a community.

Cheat sheets/quickstarts

Keep these handy.

Courses and books

If you like self-guided courses, try one of these:

If you like taking online courses with a group, I’ve heard this one is good:

A good IDE will help you be more productive!

A lot of people think when you're first learning a language like Python, you'll grok it best if you use a basic text editor instead of an IDE. (It worked for me at least. I started with vim but I use multiple editors/IDEs now, depending on the task.) Some tips -

(Another side note on text editors vs. IDEs. Even if you like the lean text editor side of things - vim or Emacs, Sublime Text... Well, I still think you should check out PyCharm. I hated disliked IDEs for a long time until I tried PyCharm. Vim users, take a look at "Epic Review of PyCharm [...] From a Vim User's Perspective" (and "Part 2". The vim emulation is solid, I use it every day.)

Interactive tools for understanding Python better

Avoiding common mistakes and pitfalls

Free book (PDF): How to make mistakes in Python

Testing

One of Python's biggest strengths is its testability. Test-Driven Development and Python go together happily.

  1. start with this concise post, http://docs.python-guide.org/en/latest/writing/tests/#the-basics
  2. then try this comprehensive post. It's about unit testing with Python's Standard Library unit test package, but leads you up to introducing pytest — the best runner for any kind of tests (you can get started on that right away). It’s also the best framework for writing data-driven tests, when you’re ready to get gung-ho about testing your code :D
  3. Jeff Knupp: Improve your Python Understanding - Unit Testing
  4. When you’re ready, move onto pytest, definitely :) pytest.md

For intermediate and advanced Pythonistas

Are you intermediate or advanced? If you're not sure, one way to check:

Style guides

You don’t need to read style guides until you’re beyond beginner status. At some point that will become very valuable and helpful to you :)

There are two main style guides:

  1. The Hitchhiker's Guide to Python – opinionated guide by the legendary Kenneth Reitz of requests fame
  2. Google Python Style Guide – perhaps the most widely-used Python style guide

Special topics

Not comprehensive, but when I brain-dumped some really good things to know about, I wrote down these subjects.

Scenario guide

You're probably going to use libraries to do a lot of things. When you have a new scenario and you are thinking what should I use... You should:

  1. Ask your community :D
  2. check Hitchhiker's Guide to Python: Scenario Guide for Python Applications
  3. check Full Stack Python, another comprehensive but carefully curated guide, full of useful context, advice, etc.
  4. check Awesome Python, "A curated list of awesome Python frameworks, libraries, software and resources" — or the Pythonidae list

Fast and scalable Python - Concurrency, Parallelism

Nice cheat sheet on various non-beginner topics in Python 3

https://www.pythonsheets.com/

Concurrency?

For completely out-of-the-box Python, concurrency is slightly complicated (because of the GIL). However, it's not some no-man's-land or something. You don't need to rediscover the solution on your own. The best single summary I've seen of (preferred) concurrency options –

Myth: Python Lacks Concurrency

There are loads of options... Greenlet, Twisted. I must say, while I've used those, I tend to go for parallelism with Celery if it makes sense. While it's a different solution, it can be relevant to some of the same problems you might be trying to solve.

Parallelism/ distributed task queue

For Python projects that need some horizontal scale-out and fast performance, there's a good chance a worker-and-queue setup might work better for you, compared with single-computer concurrency. There's no question: Celery is the way to go for worker-and-queue systems in Python --

Celery

Map/Reduce and beyond (Functional Reactive Programming)

Or maybe not worker-and-queue. I've maintained some pretty iffy worker-and-queue systems. These days I reach for Apache Spark instead. Batch and stream processing, in a portable fashion, with a very declarative and maintainable API (thanks to Functional Reactive Programming).

Further Reading

Use these links to further expand your knowledge base.

r/LearnPython Wiki - Plethora of useful resources including video lectures, useful tools, and communities for learning competetive programming to keep you on an edge.

Learn Python the Hard Way (Book) - This is an excellent beginner programmer’s guide to Python. It covers “hello world” from the console to the web.

svaksha's python resources - More books, a beginner's guide to Git, blog posts on Python/CS/Data Science, videos, and workshop tutorials.

Hitchhikker's Guide to Python learning resources - Links to good python books/guides. This book itself is a practical approach to learning Python. It assumes you already know the basics, and teaches you when & how to use Python. Read this book for a more example-driven approach.

Think Like A Computer Scientist - Interactive python guide. Also includes programming a GUI, Recursion, Classes & Objects, and includes interesting game examples.

If you're coming from Java, you should watch this video for sure and/or grab this ~70-page book

Writing a program and none of the guides/docs are helping out? Ask real programmers for help on Stackoverflow

About

[Archived.] Teammates asked for Python resources; here ya go! :) For more up to date resources go here: https://github.com/alexmojaki/futurecoder and https://github.com/vinta/awesome-python#resources

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published