2017-09-03から1日間の記事一覧

「PythonとJavaScriptではじめるデータビジュアライゼーション」を読む

3.4 CSV,TSV,行/列データ形式 import csv nobel_winners = [ {'category':'physics', 'name':'Albert Einstein', 'nationality':'Swiss', 'sex':'male', 'year':1921}, {'category':'physics', 'name':'Paul Dirac', 'nationality':'British', 'sex':'male',…

「PythonとJavaScriptではじめるデータビジュアライゼーション」を読む

3.3システムファイル nobel_winners = [ {'category':'physics', 'name':'Albert Einstein', 'nationality':'Swiss', 'sex':'male', 'year':1921}, {'category':'physics', 'name':'Paul Dirac', 'nationality':'British', 'sex':'male', 'year':1933}, {'ca…

「PythonとJavaScriptではじめるデータビジュアライゼーション」を読む

2.4.8 JavaScriptのクロージャとモジュールパターン 2-4-8.js function Counter(inc){ var count = 0; var add = function(){ count += inc; console.log('Current count:' + count); } return add; } var inc2 = Counter(2); inc2(); inc2(); inc2(); inc2(…

「PythonとJavaScriptではじめるデータビジュアライゼーション」を読む

2.4.5 Underscore 2-4-5.js var journeys = [ {period:"morning",times:[44,34,56,31]}, {period:"evening",times:[35,33]}, {period:"morning",times:[33,29,35,41]}, {period:"evening",times:[24,45,27]}, {period:"morning",times:[18,23,28]} ]; var gr…

「PythonとJavaScriptではじめるデータビジュアライゼーション」を読み始める

2.3.6簡単なデータ処理 例 2-4(page20) 2-3-6.js //A var studentData = [ {name:'Bob',id:0,'scores':[68,75,76,81]}, {name:'Alice',id:1,'scores':[75,90,64,88]}, {'name':'Carol',id:2,'scores':[59,74,71,68]}, {'name':'Dan',id:3,'scores':[64,58,53…