cms.631 s17 lecture 2 notes: getting and cleaning …cms.631 s17 lecture 2 notes: getting and...

23
!"#$% '#()$ "**+ ,- .,"./#0 1* -2+#(23' 1

Upload: others

Post on 19-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

!"#$% '#()$&"**+ ,- .,"./#0 1* -2+#(23'&

1

Page 2: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

2

Page 3: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

4()1#-(' '5*)/1 526# ("2.7#1 2// (5# (8$#' *9 12(2 (5#8 ."#2(# 9*" *-# :;<5*)"&$#",*1=&!2," (5#+ )$&2-1 526# (5#+ '$#-1 > (* ?@ +,-)(#' (2/7 2A*)( (5#'# (5"## B)#'(,*-'=&C5#- A",-3 (5#+ 2// A2.7 (*3#(5#" 2-1 2'7 (5#+ (* '52"#&2-8(5,-3 ,-(#"#'(,-3 (5#8&(2/7#1&2A*)(=&&D#&')"#&(*&5,35/,35(&2-8&12(2&(52(&(5#8&1,1-E(&"#2/,F#&G2'&A#,-3&.*//#.(#10 2-8&12(2 (5#8&3*( G*"",#1&2A*)(0 2-1&#6#- +#-(,*- $*(#-(,2/&)'#'H+,')'#'=&

3

Page 4: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

4

Page 5: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

I#+A#",-3 (5#&JK'7,-3 L**1 M)#'(,*-'J NCOP'6 2.(,6,(80&G# 526# 2&/,'( *9 '*)".#'&9*"&3#((,-3&12(2&

5

Page 6: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

Q9&(5#&12(2&1*#'-E(&#R,'(&8*)&.2-&+27#&,(&8*)"'#/9=&

S2"/8 *- ,- (5# .*-9/,.( ,- 48",2 2 T)(.5 (##-23#" '.*)"#1&6,1#*' 2-1 +#''23#'&A*2"1' (*&."#2(#&(5#&2)(5*",(2(,6#&'*)".#&9*" +2$' *9 G5*&.*-("*//#1&G5,.5&(#"",(*"8=&C5# #R2+$/# *9 (5# /#9( '5*G' *-# *9 (5#'# +2$'= 4.*)",-3 $)A/,.&'*)".#' 2-1&233"#32(,-3&,-9*"+2(,*-&/#(&2-&,'*/2(#1&,-1,6,1)2/ (*&A#.*+#&(5#&"#/,#1<*-&'(2-12"1&2."*'' (5#&3/*A#=&

C5# #R2+$/# *- (5# ",35( .*+#' 9"*+ QPN2(.5&< 2&12(2A2'#&*9 $#*$/#&G5*&/,'(&(5#+'#/6#'&*-&U,-7#1Q-&2'&G*"7,-3&G,(5,-&(5#&V4&Q-(#//,3#-.#&P*++)-,(8=&P"#2(,-3&(5,'&12(2A2'#0&9"*+&$)A/,./8&$*'(#1&12(20&"#6#2/#1&92"&+*"#&(52-&G2'&$"#6,*)'/8&7-*G- 2A*)( ./2'',9,#1 $"*W#.('&G,(5,- (5# 1#9#-'# 2-1 ,-(#//,3#-.#&'#.(*"=&

6

Page 7: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

Q(&,'&)'#9)/&(*&)-1#"'(2-1&2&/,((/#&2A*)(&(5#&G#A&G5#-&8*)&(5,-7&2A*)(&'."2$,-3&12(2=&&N#A$23#'&2"#&."#2(#1 ,- XCYU0 G5,.5 ,' W)'( 2 /,'( *9&'$#.,2/ ,-'(").(,*-' ,- 2 (#R( 9,/#&(52(&(#//&2&A"*G'#"&5*G&(*&'5*G&(5,-3'&(*&)'=&&C5#'#&,-'(").(,*-'&3#(&()"-#1&,-(*&'*+#(5,-3 .2//#1 (5#&JT*.)+#-( ZAW#.( Y*1#/J=& C5,'&,'&A#'( 1"2G- 2'&2 ("## [2'&'5*G- *- (5# /#9(\0 2-1 8*) .2- (5,-7&2A*)( '."2$,-3&2'&(5# $"*.#''&*9 (#//,-3 (5#&.*+$)(#" 2 $2((#"- (* ,1#-(,98&(5# /#26#'&*- (5,'&("## (52( 526# (5#&.*-(#-( 8*) G2-( (*&#R("2.(=&

7

Page 8: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

X#"#E' 2 .52"( Q /,7# (* 1"2G&(* +2$ *)( 2 '$2.# *9 (**/'= C5# 6#"(,.2/&2R,' +#2')"#&5*G&#2'8 (*&/#2"-&2&(**/ ,'= C5#&5*",F*-(2/&2R,' +#2')"#&5*G +2-8 (5,-3'&2&(**/&1*#'=&C5# (*$ ",35( B)21"2-( ,' G52( Q .2// (5#&J,Y*6,#J .*"-#"&< 9*"&(**/'&(52(&1*&*-#&(5,-3&2-1&2"#&$"#((8 #2'8 (*&/#2"-= C5#&A*((*+ /#9( ,' G5#"#&.*+$)(#" $"*3"2++,-3&3*#']&8*) G2-( (* 26*,1 ,( 2( 2//&.*'('&A#.2)'# ,( ,'&52"1 2-1 (27#'&2 /*-3 (,+#=&

C5,' $2"(,.)/2" .52"( '5*G' '*+# (**/' $#*$/# )'# (*&'."2$# 12(2=&

8

Page 9: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

I#21,-3 1,'.)'',*- B)#'(,*-'%&^& K..#''H,-(#"$"#(2(,*-H)'#&< ,' L)"'(#,-E' +*1#/&9*"&J#99#.(,6# )'#J (**&

(#.5-*/*38&.#-(",.&2-1&(5)'&'#/9<1#9#2(,-3_&^& N52(&+*1#/' *9 .,(,F#-'5,$ 2"# (5#8 ,-6*7,-3_ T*#' (5#&JY*-,(*",2/J 1#9,-,(,*-&

*9 .,(,F#-'5,$&9##/ "#2/,'(,.&*" ,1#2/,'(,. (*&8*)_&^& I#+#+A#" (52( *$#- 12(2 ,' (5# A#3,--,-30 -*( (5# #-1 *9 (5# $"*.#'' *9&

.,(,F#- #-323#+#-(&^& 4*.,2/&.*-(#R( ,' .",(,.2/ (* (5,-7&2A*)( 12(2 2-1&)'# [#-("#-.5,-3 2-1 '#"6,.#&

#R,'(,-3&$*G#" '(").()"#'\&^& L)",-&2"3)#'&9*"&(5#&#.*-*+,.&,+$2.(&*9&*$#-&12(20&2-1&52'&-)+#"*)'&$",62(#&

.*"$*"2(#&#R2+$/#'0 A)( 29(#" D)"352"( 1*&8*) (")'( (5#'#_&

9

Page 10: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

Z-.#&G#&526#&(5#&12(20&G#&-##1&(*&(5,-7&2A*)(&5*G&G#&'5*)/1&'(*"#&,(&(*&+27#&,(&#2'8 (*&)'#`&

10

Page 11: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

^& aU4&H P4b&9,/#' 2"# (5# '(2-12"1 9*" +*'( *"32-,F2(,*-'&^& I#/2(,*-2/&12(2A2'#' 5#/$ G5#- 8*) 526# /*(' *9 12(2 2-1 ,( 2//&"#/2(#' (* *-#&

2-*(5#"= O*" ,-'(2-.#&$#"52$' 8*)&526#&+2-8 ',(#' G,(5,-&2&9**1&"#'.)#&*"32-,F2(,*-0 2// *9 G5*+ "#.#,6#&+2-8 1,99#"#-( (8$#' *9&1*-2(,*-' 9"*+&+)/(,$/#&'*)".#'= C5#&',(#'0 1*-2(,*-'0 2-1&'*)".#'&G*)/1&2// A# (5,-3' (52(&2"#&"#/2(#1&(*&#2.5&*(5#"=&

^& c*-<"#/2(,*-2/ 12(2A2'#' 2"# 3**1 G5#- 8*) -##1 (* '(*"# 2-1&2..#'' /#''&9*"+2//8&'(").()"#1&,-9*"+2(,*-=&C5#8E"#&6#"8&("#-18&",35(&-*G=&

^& C#R( 9,/#' 2"# )')2//8 +*"# )-'(").()"#10 2-1 .2- A# 52"1#" (* G*"7 G,(5&)-/#'' (5#&(#R( ,' 2// B)2/,(2(,6#=&

^& !TO 9,/#' 2"# (5# G*"'(0 2-1 '21/8 2"# 2 '(2-12"1 9*" *$#- 12(2 "#/#2'#' 9"*+&3*6#"-+#-(' (52(&1*-E( "#2//8&G2-( 8*)&(*&526#&(5#&12(2=&

^& XCYU (2A/#' 2"# -,.#0 A)( '*+#(,+#' 52"1 (* ()"- ,-(* '*+#(5,-3 8*) .2- )'#&,- 2- 2-2/8',' (**/&/,7# C2A/#2) *" SR.#/=&

11

Page 12: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

K'7 9*/7' G52( (5#8 (5,-7&J./#2- 12(2J +#2-'= N",(# )$ $*,-(' *- (5# A*2"1 9*" 2 9#G&+,-)(#'=&

12

Page 13: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

X#"#E' G52(&J./#2- 12(2J +#2-' (* +#=& I#+#+A#" (52( d@e *9 (5# (,+# *9 2-8 12(2&$"*W#.( ,' )')2//8 '$#-( ./#2-,-3&(5#&12(20 '*&(5,' ,' 2&A,3&1#2/=&

I#+#+A#" (52( (5# +#(212(2 ,' ,+$*"(2-( (**&< (5,'&1#'.",A#'&G52(&(5#&12(2&,'=&&N52(&1*#'&#2.5&.*/)+-&5#21#" +#2-_&N5#-&G2' (5#&12(2&.*//#.(#1_& N52( 1*&A/2-7' *"&F#"*'&+#2-_ N52( G2'&/#9( *)( [,-(#-(,*-2//8&*" )-,-(#-(,*-2//8\&

13

Page 14: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

I#21,-3&"#6,#G%&^& I)- (5"*)35 *-# *9 N,.752+E' .*+$2",'*-' *9 "*G<2(*+,. 6'=&-*(&

14

Page 15: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

X#"#E' 2 .52"( Q /,7# (* 1"2G&(* +2$ *)( 2 '$2.# *9 (**/'= C5# 6#"(,.2/&2R,' +#2')"#&5*G&#2'8 (*&/#2"-&2&(**/ ,'= C5#&5*",F*-(2/&2R,' +#2')"#&5*G +2-8 (5,-3'&2&(**/&1*#'=&C5# (*$ ",35( B)21"2-( ,' G52( Q .2// (5#&J,Y*6,#J .*"-#"&< 9*"&(**/'&(52(&1*&*-#&(5,-3&2-1&2"#&$"#((8 #2'8 (*&/#2"-= C5#&A*((*+ /#9( ,' G5#"#&.*+$)(#" $"*3"2++,-3&3*#']&8*) G2-( (* 26*,1 ,( 2( 2//&.*'('&A#.2)'# ,( ,'&52"1 2-1 (27#'&2 /*-3 (,+#=&

C5,' $2"(,.)/2" .52"( '5*G' '*+# (**/' $#*$/# )'# (*&./#2- 12(2=& T*-E( 9*"3#( (5#&$*G#" *9 9,-1&2-1&"#$/2.#`&

15

Page 16: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

16

Page 17: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

17

Page 18: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

18

Page 19: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

C**/' /,7# L**3/# !5*(*' 2)(*+2(,.2//8 1#(#.( *AW#.(' ,- 8*)" $5*(*' -*G=& f*)&.2-&"#$)"$*'# (52( (* 1",6# 8*)"&12(2&2-2/8',' ,9 8*) 526# /*('&*9 $5*(*' 8*)&2"#&G*"7,-3&G,(5= Q( .2- 2-'G#" B)#'(,*-'&/,7#&J5*G&+2-8 $5*(*' ,- +8 '#( 526# 2 .2"JH&

19

Page 20: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

U#(' ")-&2-*(5#" .",(,B)#0 (5,' (,+#&*9&2-&,-(#"2.(,6#&12(2&6,')2/,F2(,*-=&

20

Page 21: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

K'7 9*/7' (5#'# B)#'(,*-' (* 5#/$ (5#+ "#21 (5# .52"( 2-1 '(2"( (* .",(,B)# ,(=&^& N52( 12(2'#(' 2"# A#,-3&"#$"#'#-(#1 5#"#_&

g& V4 3#*3"2$58&g& T2,/8 (#+$#"2()"#&J2-*+2/,#'J [12(#0 (#+$#"2()"#0 /*.2(,*-\&g& !"*$*"(,*- *9 G2"+ (* .*/1 2-*+2/,#'&

^& N52(&6,')2/&+2$$,-3' 2"# )'#1 (* '5*G 12(2_&g& Y2$&'5*G' G5#"# (5# *..)""#1&g& P*/*"#1 1*(' '5*G' (#+$ *9 2-*+2/8&g& U,-#&.52"( '5*G' "2(,*&*6#" (,+#&

^& N52( ,' (5# *-#<'#-(#-.# '(*"8&5#"#_&g& C5#"# 2"# +*"# 2-1 +*"# G2"+ (#+$#"2()"# 2-*+2/,#' *6#" (,+#&

^& T* 8*) (5,-7 (5,' '(*"8 ,' G#//&(*/1_&

21

Page 22: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

C2A/#2) 3,6#' *)( 9"## 8#2"</*-3 /,.#-'#' (* '()1#-('=&

22

Page 23: CMS.631 S17 Lecture 2 notes: Getting and Cleaning …CMS.631 S17 Lecture 2 notes: Getting and Cleaning Data Author Rahul Bhargava Created Date 20180112203435Z

MIT OpenCourseWare https://ocw.mit.edu/

CMS.631 Data Storytelling Studio: Climate Change Spring 2017

For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.

23