OPERATIONS
Parenthesis have priority STRINGS
VARIABLES NAMES RULES
VARIABLE TYPES
sets differs from dictionary because has no keys and has unique values |
INDEXING
LOOPS
* elif: will execute only the first true condition |
FUNCTIONS
In functions param1 defines the default parameter if there is no input. lambda: take what: give what. map: it applies a function to something. map(what, to_what). Also, the list is necessary to have the right output. apply works on a row / column basis of a DataFrame, applymap works element-wise on a DataFrame, and map works element-wise on a Series. filter: takes out only the results of a certain condition METHODS
split() supports also indexing after: str.split()[0] |
Cheatography
https://cheatography.com
Python basics Cheat Sheet (DRAFT) by aggialavura
Basics commands for Python
This is a draft cheat sheet. It is a work in progress and is not finished yet.