Hello P y thon ! IN TR OD U C TION TO P YTH ON H u go Bo w ne - - - PowerPoint PPT Presentation

hello p y thon
SMART_READER_LITE
LIVE PREVIEW

Hello P y thon ! IN TR OD U C TION TO P YTH ON H u go Bo w ne - - - PowerPoint PPT Presentation

Hello P y thon ! IN TR OD U C TION TO P YTH ON H u go Bo w ne - Anderson Data Scientist at DataCamp Ho w y o u w ill learn INTRODUCTION TO PYTHON P y thon General p u rpose : b u ild an y thing Open so u rce ! Free ! P y thon packages , also for


slide-1
SLIDE 1

Hello Python!

IN TR OD U C TION TO P YTH ON

Hugo Bowne-Anderson

Data Scientist at DataCamp

slide-2
SLIDE 2

INTRODUCTION TO PYTHON

How you will learn

slide-3
SLIDE 3

INTRODUCTION TO PYTHON

Python

General purpose: build anything Open source! Free! Python packages, also for data science Many applications and elds Version 3.x - hps://www.python.org/downloads/

slide-4
SLIDE 4

INTRODUCTION TO PYTHON

IPython Shell

Execute Python commands

slide-5
SLIDE 5

INTRODUCTION TO PYTHON

IPython Shell

Execute Python commands

slide-6
SLIDE 6

INTRODUCTION TO PYTHON

IPython Shell

slide-7
SLIDE 7

INTRODUCTION TO PYTHON

Python Script

Text les - .py List of Python commands Similar to typing in IPython Shell

slide-8
SLIDE 8

INTRODUCTION TO PYTHON

Python Script

slide-9
SLIDE 9

INTRODUCTION TO PYTHON

Python Script

Use print() to generate output from script

slide-10
SLIDE 10

INTRODUCTION TO PYTHON

DataCamp Interface

slide-11
SLIDE 11

Let's practice!

IN TR OD U C TION TO P YTH ON

slide-12
SLIDE 12

Variables and Types

IN TR OD U C TION TO P YTH ON

Hugo Bowne-Anderson

Data Scientist at DataCamp

slide-13
SLIDE 13

INTRODUCTION TO PYTHON

Variable

Specic, case-sensitive name Call up value through variable name 1.79 m - 68.7 kg

height = 1.79 weight = 68.7 height 1.79

slide-14
SLIDE 14

INTRODUCTION TO PYTHON

Calculate BMI

height = 1.79 weight = 68.7 height 1.79

BMI =

68.7 / 1.79 ** 2 21.4413 weight / height ** 2 21.4413 bmi = weight / height ** 2 bmi 21.4413

height2 weight

slide-15
SLIDE 15

INTRODUCTION TO PYTHON

Reproducibility

height = 1.79 weight = 68.7 bmi = weight / height ** 2 print(bmi) 21.4413

slide-16
SLIDE 16

INTRODUCTION TO PYTHON

Reproducibility

height = 1.79 weight = 74.2 # <- bmi = weight / height ** 2 print(bmi) 23.1578

slide-17
SLIDE 17

INTRODUCTION TO PYTHON

Python Types

type(bmi) float day_of_week = 5 type(day_of_week) int

slide-18
SLIDE 18

INTRODUCTION TO PYTHON

Python Types (2)

x = "body mass index" y = 'this works too' type(y) str z = True type(z) bool

slide-19
SLIDE 19

INTRODUCTION TO PYTHON

Python Types (3)

2 + 3 5 'ab' + 'cd' 'abcd'

Dierent type = dierent behavior!

slide-20
SLIDE 20

Let's practice!

IN TR OD U C TION TO P YTH ON