Beginner Python Cheatsheet

26 Jan 2020

The Beginner’s Python Cheatsheet!

This is a reference list of basic Python code, mostly in the context of Data Science.

Also available on Github if you want to fork the repo!

Where I’ve put in links, these guys have already done a great job of it, so I’ll leave it to the experts - just click into it!

Most of this will be quite basic, likely most valuable for beginner individuals just doing a quick Google to figure something out. This list is not meant to be exhaustive, just sufficient for basic purposes.

Standard terms used below - replace with your own:

I use quite a fair bit of pandas (it’s a library for the uninitiated), just because it is so much more efficient and straightforward.

This is very much still a work in progress so do pardon the messiness for now. I am also just still learning so if there are any areas of improvement, please do share.


1 - Getting Data In

2 - Exploring the Data

3 - Cleaning the Data

4 - Manipulating the Data

5 - Visualizing the Data

10 - General tips & tricks

Edit: 19 August 2020

So the folks at Toptal (a company that helps to connect companies with talent) have come up with an hiring guide for python here:

I think it provides some helpful tips and interesting perspectives on how different people view/use python so it is worth a read (for any python user, be it hiring managers or applicants)!

just keep in mind that people are entitled to their own opinions and you don’t necessarily have to agree with theirs! (like, i think pytest has a pretty big following too, compared to unittest for unit testing?)

also… if i were you i’d be cautious about hiring a (purely) python web developer haha (hi javascript!)