Why and How I Forced Myself To Learn Python - Clean
Why and How I Forced Myself To Learn Python - Clean
Why PYTHON?
• Free
• Massive Communities
• Massive libraries
• Massive open sources
• Most popular programming
language in the AI/Deep
Learning era.
First Thing: setting up environment
• Option 1: Setup your own env by installing a bunch of things: IDEs,
Libraries, Virtual Envs and so on.
• Shortcut: Nothing to install with ANZ Data Analytics Platform using
IBM Cloud Pak for Data (CP4D).
• Create a project
• Add “notebook”
• Here you go!
• Video: Create a project
2 Good Enough Knowledge to start
to understand python code
1) Code block is defined by indention!
2) Colon( : ) is start of a new block in many constructs, e.g. function definitions, if clauses
Start from learn/modify existing
code
• Import libraries
• Define a function
• How to comment
• How to define a variable
• How to print
How to solve problems:
Google Search -> Copy -> Paste -> Try
• Search when you don’t how to
do, example:
• “python operator logical not equal”
• “python dataframe replace column
name”
• Search when you don’t
understand the code,
example:
• 'c' in a
You can search a way more…
• When I was having Network issues, I found:
source
Enough to Understand the Code
· Indentation matters to code meaning
• Block structure indicated by indentation
· First assignment to a variable creates it
• Variable types don’t need to be declared.
• Python figures out the variable types on its own.
· Assignment is = and comparison is ==
· For numbers + - * / % are as expected
• Special use of + for string concatenation and % for
string formatting (as in C’s printf)
· Logical operators are words (and, or,
not) not symbols
· The basic printing command is print
Most important function: print
• Grammar: print()
• A string: print(’hello world’)
• print Item1, Item2, ..., ItemN