Python Data Processing with Pandas CSE 5542 Introduc:on to Data - - PowerPoint PPT Presentation

python data processing with pandas
SMART_READER_LITE
LIVE PREVIEW

Python Data Processing with Pandas CSE 5542 Introduc:on to Data - - PowerPoint PPT Presentation

Python Data Processing with Pandas CSE 5542 Introduc:on to Data Visualiza:on Pandas A very powerful package of Python for manipula:ng tables Built on top of numpy, so is efficient Save you a lot of effort from wri:ng lower python


slide-1
SLIDE 1

Python Data Processing with Pandas

CSE 5542 Introduc:on to Data Visualiza:on

slide-2
SLIDE 2

Pandas

  • A very powerful package of Python for

manipula:ng tables

  • Built on top of numpy, so is efficient
  • Save you a lot of effort from wri:ng lower

python code for manipula:ng, extrac:ng, and deriving tables related informa:on

  • Easy visualiza:on with Matplotlib
  • Main data structures – Series and DataFrame
slide-3
SLIDE 3
  • First thing first
  • Series: an indexed 1D array
slide-4
SLIDE 4
  • Explicit index
  • Access data
slide-5
SLIDE 5
  • Can work as a dic:onary
  • Access and slice data
slide-6
SLIDE 6

DataFrame Object

  • Generalized two dimensional array with

flexible row and column indices

slide-7
SLIDE 7

DataFrame Object

  • Generalized two dimensional array with

flexible row and column indices

slide-8
SLIDE 8

DataFrame Object

  • From Pandas Series
slide-9
SLIDE 9

DataFrame Object

  • From Pandas Series
slide-10
SLIDE 10

DataFrame Object

  • Another example
slide-11
SLIDE 11

Viewing Data

  • View the first or last N rows
slide-12
SLIDE 12

Viewing Data

  • Display the index, columns, and data
slide-13
SLIDE 13

Viewing Data

  • Quick sta:s:cs (for columns A B C D in this

case)

slide-14
SLIDE 14

Viewing Data

  • Sor:ng: sort by the index (i.e., reorder

columns or rows), not by the data in the table

column

slide-15
SLIDE 15

Viewing Data

  • Sor:ng: sort by the data values
slide-16
SLIDE 16

Selec:ng Data

  • Selec:ng using a label
slide-17
SLIDE 17

Selec:ng Data

  • Mul:-axis, by label
slide-18
SLIDE 18

Selec:ng Data

  • Mul:-axis, by label

Slicing: last included

slide-19
SLIDE 19

Selec:ng Data

  • Select by posi:on
slide-20
SLIDE 20

Selec:ng Data

  • Boolean indexing
slide-21
SLIDE 21

Selec:ng Data

  • Boolean indexing
slide-22
SLIDE 22

SeZng Data

  • SeZng a new column aligned by indexes
slide-23
SLIDE 23

SeZng Data

slide-24
SLIDE 24

Opera:ons

  • Descrip:ve sta:s:cs

– Across axis 0 (rows), i.e., column mean – Across axis 1 (column), i.e., row mean

slide-25
SLIDE 25

Opera:ons

  • Apply
  • Histogram
slide-26
SLIDE 26

Merge Tables

  • Join
slide-27
SLIDE 27

Merge Tables

  • Append
slide-28
SLIDE 28

Grouping

slide-29
SLIDE 29

File I/O

  • CSV
slide-30
SLIDE 30

File I/O

  • Excel