Python for Data Processing and Plo3ng Han-Wei Shen The Ohio State - - PowerPoint PPT Presentation

python for data processing and plo3ng
SMART_READER_LITE
LIVE PREVIEW

Python for Data Processing and Plo3ng Han-Wei Shen The Ohio State - - PowerPoint PPT Presentation

Python for Data Processing and Plo3ng Han-Wei Shen The Ohio State University (with help from Jonathan Woodring at Los Alamos NaConal Laboratory) What is Python? Fast code development and test A dynamically typed language You do not


slide-1
SLIDE 1

Python for Data Processing and Plo3ng

Han-Wei Shen The Ohio State University (with help from Jonathan Woodring at Los Alamos NaConal Laboratory)

slide-2
SLIDE 2

What is Python?

  • Fast code development and test
  • A dynamically typed language

– You do not need to declare the type of a variable

  • Syntax is very much C-like
  • A huge number of packages for

doing almost everything (numpy, scipy, matplotlib, …)

  • AutomaCc memory management
  • FuncCons can be passed around as

arguments

  • Can bind to C code easily for speed

(from Jonathan Woodring, Los Alamos NL)

slide-3
SLIDE 3

Variable Assignment

slide-4
SLIDE 4

More Assignment

slide-5
SLIDE 5

Lists

slide-6
SLIDE 6

Slicing Lists

slide-7
SLIDE 7

Slicing Lists

slide-8
SLIDE 8

IteraCng Lists with Loops

slide-9
SLIDE 9

IteraCng Lists with Loops

slide-10
SLIDE 10

If-Then-Else

slide-11
SLIDE 11

Tuples are Immutable

slide-12
SLIDE 12

DicConaries

slide-13
SLIDE 13

FuncCon DefiniCons

slide-14
SLIDE 14

File I/O

slide-15
SLIDE 15

NumPy

  • The most popular package for scienCfic compuCng

– Efficient N-dimensional arrays – Useful for linear algebra, data transformaCon etc.

  • Get Numpy from hYp://www.scipy.org
slide-16
SLIDE 16

NumPy

  • The most popular package for scienCfic compuCng

– Efficient N-dimensional arrays – Useful for linear algebra, data transformaCon etc.

  • Get Numpy from hYp://www.scipy.org
slide-17
SLIDE 17

NumPy Slicing

slide-18
SLIDE 18

NumPy Array Reshaping

slide-19
SLIDE 19

NumPy Array BroadcasCng

slide-20
SLIDE 20

NumPy Linear Algebra

slide-21
SLIDE 21

NumPy I/O

slide-22
SLIDE 22

Matplotlib

  • Python 2D plo3ng package that produces publicaCon quality figures
  • Get it from hYp://matplotlib.org
slide-23
SLIDE 23

Line Graphs

slide-24
SLIDE 24

Images

slide-25
SLIDE 25

Histograms