-
Notifications
You must be signed in to change notification settings - Fork 5
/
data-science-digest-volume-3.html
888 lines (753 loc) · 43 KB
/
data-science-digest-volume-3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
<!DOCTYPE html>
<!--[if lt IE 9 ]><html class="no-js oldie" lang="zh-hant-tw"> <![endif]-->
<!--[if IE 9 ]><html class="no-js oldie ie9" lang="zh-hant-tw"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html class="no-js" lang="zh-hant-tw">
<!--<![endif]-->
<head>
<!--- basic page needs
================================================== -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="Lee Meng" />
<title>LeeMeng - 資料科學文摘 Vol.3 Pandas、Docker 以及數據時代的反思</title>
<!--- article-specific meta data
================================================== -->
<meta name="description" content="不同於上週的文摘,這週的選文比較技術以及實作導向。本週將導讀 3 篇使用 Python 以及 Pandas 的文章,並鼓勵讀者實際動手學習。我們也會看到如何使用 Docker 來讓資料科學變得更簡單,並提供一個有趣的貓咪圖片辨識 App 給有興趣的讀者參考。最後,讓我們分別看看哈佛商業評論以及美國前首席資料科學家 DJ Patil 談談如何讓資料科學在企業內普及,以及數據時代我們面臨的各種道德議題。" />
<meta name="keywords" content="文摘, Pandas, SQL, Docker, 資料科學" />
<meta name="tags" content="文摘" />
<meta name="tags" content="Pandas" />
<meta name="tags" content="SQL" />
<meta name="tags" content="Docker" />
<meta name="tags" content="資料科學" />
<!--- Open Graph Object metas
================================================== -->
<meta property="og:image" content="https://leemeng.tw/theme/images/background/thought-catalog-575840-unsplash.jpg" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://leemeng.tw/data-science-digest-volume-3.html" />
<meta property="og:title" content="資料科學文摘 Vol.3 Pandas、Docker 以及數據時代的反思" />
<meta property="og:description" content="不同於上週的文摘,這週的選文比較技術以及實作導向。本週將導讀 3 篇使用 Python 以及 Pandas 的文章,並鼓勵讀者實際動手學習。我們也會看到如何使用 Docker 來讓資料科學變得更簡單,並提供一個有趣的貓咪圖片辨識 App 給有興趣的讀者參考。最後,讓我們分別看看哈佛商業評論以及美國前首席資料科學家 DJ Patil 談談如何讓資料科學在企業內普及,以及數據時代我們面臨的各種道德議題。" />
<!-- mobile specific metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS
================================================== -->
<!--for customized css in individual page-->
<link rel="stylesheet" type="text/css" href="https://leemeng.tw/theme/css/bootstrap.min.css">
<!--for showing toc navigation which slide in from left-->
<link rel="stylesheet" type="text/css" href="https://leemeng.tw/theme/css/toc-nav.css">
<!--for responsive embed youtube video-->
<link rel="stylesheet" type="text/css" href="https://leemeng.tw/theme/css/embed_youtube.css">
<!--for prettify dark-mode result-->
<link rel="stylesheet" type="text/css" href="https://leemeng.tw/theme/css/darkmode.css">
<link rel="stylesheet" type="text/css" href="https://leemeng.tw/theme/css/base.css">
<link rel="stylesheet" type="text/css" href="https://leemeng.tw/theme/css/vendor.css">
<link rel="stylesheet" type="text/css" href="https://leemeng.tw/theme/css/main.css">
<link rel="stylesheet" type="text/css" href="https://leemeng.tw/theme/css/ipython.css">
<link rel="stylesheet" type="text/css" href='https://leemeng.tw/theme/css/progress-bar.css' />
<!--TiqueSearch-->
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400">
<link rel="stylesheet" href="https://leemeng.tw/theme/tipuesearch/css/normalize.css">
<link rel="stylesheet" href="https://leemeng.tw/theme/tipuesearch/css/tipuesearch.css">
<!-- script
================================================== -->
<script src="https://leemeng.tw/theme/js/modernizr.js"></script>
<script src="https://leemeng.tw/theme/js/pace.min.js"></script>
<!-- favicons
================================================== -->
<link rel="shortcut icon" href="../theme/images/favicon.ico" type="image/x-icon"/>
<link rel="icon" href="../theme/images/favicon.ico" type="image/x-icon"/>
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-106559980-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', 'UA-106559980-1');
</script>
</head>
<body id="top">
<!-- header
================================================== -->
<header class="s-header">
<div class="header-logo">
<a class="site-logo" href="../index.html"><img src="https://leemeng.tw/theme/images/logo.png" alt="Homepage"></a>
</div>
<!--navigation bar ref: http://jinja.pocoo.org/docs/2.10/tricks/-->
<nav class="header-nav-wrap">
<ul class="header-nav">
<li>
<a href="../index.html#home">Home</a>
</li>
<li>
<a href="../index.html#about">About</a>
</li>
<li>
<a href="../index.html#projects">Projects</a>
</li>
<li class="current">
<a href="../blog.html">Blog</a>
</li>
<li>
<a href="https://demo.leemeng.tw">Demo</a>
</li>
<li>
<a href="../books.html">Books</a>
</li>
<li>
<a href="../index.html#contact">Contact</a>
</li>
</ul>
<!--<div class="search-container">-->
<!--<form action="../search.html">-->
<!--<input type="text" placeholder="Search.." name="search">-->
<!--<button type="submit"><i class="im im-magnifier" aria-hidden="true"></i></button>-->
<!--</form>-->
<!--</div>-->
</nav>
<a class="header-menu-toggle" href="#0"><span>Menu</span></a>
</header> <!-- end s-header -->
<!--TOC navigation displayed when clicked from left-navigation button-->
<div id="tocNav" class="overlay" onclick="closeTocNav()">
<div class="overlay-content">
<div id="toc"><ul><li><a class="toc-href" href="#" title="資料科學文摘 Vol.3 Pandas、Docker 以及數據時代的反思">資料科學文摘 Vol.3 Pandas、Docker 以及數據時代的反思</a><ul><li><a class="toc-href" href="#本週閱讀清單" title="本週閱讀清單">本週閱讀清單</a></li><li><a class="toc-href" href="#How-to-Master-Your-Skills-for-Pandas?" title="
How to Master Your Skills for Pandas?
">
How to Master Your Skills for Pandas?
</a></li><li><a class="toc-href" href="#How-to-rewrite-your-SQL-queries-in-Pandas,-and-more" title="
How to rewrite your SQL queries in Pandas, and more
">
How to rewrite your SQL queries in Pandas, and more
</a></li><li><a class="toc-href" href="#Learn-Functional-Python-in-10-Minutes" title="
Learn Functional Python in 10 Minutes
">
Learn Functional Python in 10 Minutes
</a></li><li><a class="toc-href" href="#Docker-for-Data-Scientists" title="
Docker for Data Scientists
">
Docker for Data Scientists
</a><ul><li><a class="toc-href" href="#Try-It-Yourself" title="Try It Yourself">Try It Yourself</a></li></ul></li><li><a class="toc-href" href="#The-Democratization-of-Data-Science_1" title="
The Democratization of Data Science
">
The Democratization of Data Science
</a></li><li><a '="" class="toc-href" day="" href="#Data" of="" reckoning="" s="" s-day-of-reckoning'="" title="
Data">
Data's day of reckoning
</a></li><li><a class="toc-href" href="#結語" title="結語">結語</a></li></ul></li></ul></div>
</div>
</div>
<!--custom images with icon shown on left nav-->
<!--the details are set in `pelicanconf.py` as `LEFT_NAV_IMAGES`-->
<article class="blog-single">
<!-- page header/blog hero, use custom cover image if available
================================================== -->
<div class="page-header page-header--single page-hero" style="background-image:url(https://leemeng.tw/theme/images/background/thought-catalog-575840-unsplash.jpg)">
<div class="row page-header__content narrow">
<article class="col-full">
<div class="page-header__info">
<div class="page-header__cat">
<a href="https://leemeng.tw/tag/wen-zhai.html" rel="tag">文摘</a>
<a href="https://leemeng.tw/tag/pandas.html" rel="tag">Pandas</a>
<a href="https://leemeng.tw/tag/sql.html" rel="tag">SQL</a>
<a href="https://leemeng.tw/tag/docker.html" rel="tag">Docker</a>
<a href="https://leemeng.tw/tag/zi-liao-ke-xue.html" rel="tag">資料科學</a>
</div>
</div>
<h1 class="page-header__title">
<a href="https://leemeng.tw/data-science-digest-volume-3.html" title="">
資料科學文摘 Vol.3 Pandas、Docker 以及數據時代的反思
</a>
</h1>
<ul class="page-header__meta">
<li class="date">2018-08-10 (Fri)</li>
<li class="page-view">
2,271 views
</li>
</ul>
</article>
</div>
</div> <!-- end page-header -->
<div class="KW_progressContainer">
<div class="KW_progressBar"></div>
</div>
<div class="row blog-content" style="position: relative">
<div id="left-navigation">
<div id="search-wrap">
<i class="im im-magnifier" aria-hidden="true"></i>
<div id="search">
<form action="../search.html">
<div class="tipue_search_right"><input type="text" name="q" id="tipue_search_input" pattern=".{2,}" title="想搜尋什麼呢?(請至少輸入兩個字)" required></div>
</form>
</div>
</div>
<div id="toc-wrap">
<a title="顯示/隱藏 文章章節">
<i class="im im-menu" aria-hidden="true" onclick="toggleTocNav()"></i>
</a>
</div>
<div id="social-wrap" style="cursor: pointer">
<a class="open-popup" title="訂閱最新文章">
<i class="im im-newspaper-o" aria-hidden="true"></i>
</a>
</div>
<div id="social-wrap">
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A//leemeng.tw/data-science-digest-volume-3.html" target="_blank" title="分享到 Facebook">
<i class="im im-facebook" aria-hidden="true"></i>
</a>
</div>
<div id="social-wrap">
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A//leemeng.tw/data-science-digest-volume-3.html&title=%E8%B3%87%E6%96%99%E7%A7%91%E5%AD%B8%E6%96%87%E6%91%98%20Vol.3%20Pandas%E3%80%81Docker%20%E4%BB%A5%E5%8F%8A%E6%95%B8%E6%93%9A%E6%99%82%E4%BB%A3%E7%9A%84%E5%8F%8D%E6%80%9D&summary=%E4%B8%8D%E5%90%8C%E6%96%BC%E4%B8%8A%E9%80%B1%E7%9A%84%E6%96%87%E6%91%98%EF%BC%8C%E9%80%99%E9%80%B1%E7%9A%84%E9%81%B8%E6%96%87%E6%AF%94%E8%BC%83%E6%8A%80%E8%A1%93%E4%BB%A5%E5%8F%8A%E5%AF%A6%E4%BD%9C%E5%B0%8E%E5%90%91%E3%80%82%E6%9C%AC%E9%80%B1%E5%B0%87%E5%B0%8E%E8%AE%80%203%20%E7%AF%87%E4%BD%BF%E7%94%A8%20Python%20%E4%BB%A5%E5%8F%8A%20Pandas%20%E7%9A%84%E6%96%87%E7%AB%A0%EF%BC%8C%E4%B8%A6%E9%BC%93%E5%8B%B5%E8%AE%80%E8%80%85%E5%AF%A6%E9%9A%9B%E5%8B%95%E6%89%8B%E5%AD%B8%E7%BF%92%E3%80%82%E6%88%91%E5%80%91%E4%B9%9F%E6%9C%83%E7%9C%8B%E5%88%B0%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20Docker%20%E4%BE%86%E8%AE%93%E8%B3%87%E6%96%99%E7%A7%91%E5%AD%B8%E8%AE%8A%E5%BE%97%E6%9B%B4%E7%B0%A1%E5%96%AE%EF%BC%8C%E4%B8%A6%E6%8F%90%E4%BE%9B%E4%B8%80%E5%80%8B%E6%9C%89%E8%B6%A3%E7%9A%84%E8%B2%93%E5%92%AA%E5%9C%96%E7%89%87%E8%BE%A8%E8%AD%98%20App%20%E7%B5%A6%E6%9C%89%E8%88%88%E8%B6%A3%E7%9A%84%E8%AE%80%E8%80%85%E5%8F%83%E8%80%83%E3%80%82%E6%9C%80%E5%BE%8C%EF%BC%8C%E8%AE%93%E6%88%91%E5%80%91%E5%88%86%E5%88%A5%E7%9C%8B%E7%9C%8B%E5%93%88%E4%BD%9B%E5%95%86%E6%A5%AD%E8%A9%95%E8%AB%96%E4%BB%A5%E5%8F%8A%E7%BE%8E%E5%9C%8B%E5%89%8D%E9%A6%96%E5%B8%AD%E8%B3%87%E6%96%99%E7%A7%91%E5%AD%B8%E5%AE%B6%20DJ%20Patil%20%E8%AB%87%E8%AB%87%E5%A6%82%E4%BD%95%E8%AE%93%E8%B3%87%E6%96%99%E7%A7%91%E5%AD%B8%E5%9C%A8%E4%BC%81%E6%A5%AD%E5%85%A7%E6%99%AE%E5%8F%8A%EF%BC%8C%E4%BB%A5%E5%8F%8A%E6%95%B8%E6%93%9A%E6%99%82%E4%BB%A3%E6%88%91%E5%80%91%E9%9D%A2%E8%87%A8%E7%9A%84%E5%90%84%E7%A8%AE%E9%81%93%E5%BE%B7%E8%AD%B0%E9%A1%8C%E3%80%82&source=https%3A//leemeng.tw/data-science-digest-volume-3.html" target="_blank" title="分享到 LinkedIn">
<i class="im im-linkedin" aria-hidden="true"></i>
</a>
</div>
<div id="social-wrap">
<a href="https://twitter.com/intent/tweet?text=%E8%B3%87%E6%96%99%E7%A7%91%E5%AD%B8%E6%96%87%E6%91%98%20Vol.3%20Pandas%E3%80%81Docker%20%E4%BB%A5%E5%8F%8A%E6%95%B8%E6%93%9A%E6%99%82%E4%BB%A3%E7%9A%84%E5%8F%8D%E6%80%9D&url=https%3A//leemeng.tw/data-science-digest-volume-3.html&hashtags=wen-zhai,pandas,sql,docker,zi-liao-ke-xue" target="_blank" title="分享到 Twitter">
<i class="im im-twitter" aria-hidden="true"></i>
</a>
</div>
<!--custom images with icon shown on left nav-->
</div>
<div class="col-full blog-content__main">
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>不同於上週的<a href="https://leemengtaiwan.github.io/data-science-digest-volume-2.html">文摘 Vol.2 產品理解以及 DS / DE 之路</a>,這週的選文比較技術以及實作導向。本週將導讀 3 篇使用 Python 以及 Pandas 的文章,並鼓勵讀者實際動手學習。我們也會看到如何使用 Docker 來讓資料科學變得更簡單,並提供一個有趣的貓咪圖片辨識 App 給有興趣的讀者參考。最後,讓我們分別看看哈佛商業評論以及美國前首席資料科學家 DJ Patil 談談如何讓資料科學在企業內普及,以及數據時代我們面臨的各種道德議題。</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="本週閱讀清單">本週閱讀清單<a class="anchor-link" href="#本週閱讀清單">¶</a></h2><ul>
<li>Pandas、Python<ul>
<li><a href="#How-to-Master-Your-Skills-for-Pandas?">How to Master Your Skills for Pandas?</a></li>
<li><a href="#How-to-rewrite-your-SQL-queries-in-Pandas,-and-more">How to rewrite your SQL queries in Pandas, and more</a></li>
<li><a href="#Learn-Functional-Python-in-10-Minutes">Learn Functional Python in 10 Minutes</a></li>
</ul>
</li>
<li>Docker <ul>
<li><a href="#Docker-for-Data-Scientists">Docker for Data Scientists</a></li>
<li><a href="#Try-It-Yourself">Cat Recognizer: A flask app showcasing how to recognize cats using Tensorflow</a></li>
</ul>
</li>
<li>數據時代的反思<ul>
<li><a href="#The-Democratization-of-Data-Science">The Democratization of Data Science</a></li>
<li><a href="#Data's-day-of-reckoning">Data's day of reckoning</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="How-to-Master-Your-Skills-for-Pandas?">
<a href="https://engmrk.com/module5-introduction-to-pandas/" target="_blank">How to Master Your Skills for Pandas?</a><a class="anchor-link" href="#How-to-Master-Your-Skills-for-Pandas?">¶</a>
</h2>
<center>
<a href="https://engmrk.com/module5-introduction-to-pandas/" target="_blank">
<img src="https://leemeng.tw/images/digests/Module-5-Introduction-to-Pandas.png"/>
</a>
<br/>
</center>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Python 裡頭最著名的資料處理 library 非 <a href="https://pandas.pydata.org/">Pandas</a> 莫屬了。<a href="https://engmrk.com/module5-introduction-to-pandas/">這篇文章</a>使用互動式的環境,列出挺完整的 Pandas 指令讓讀者可以邊參考 sample code 邊自己動手玩玩看。</p>
<p>其中包含各種利用 Series 以及 Dataframe 兩種 Pandas 常見的資料格式來對數據進行各種操作,適合沒碰過 Pandas 的新手以及想要重新 refresh 語法的人。</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="How-to-rewrite-your-SQL-queries-in-Pandas,-and-more">
<a href="https://codeburst.io/how-to-rewrite-your-sql-queries-in-pandas-and-more-149d341fc53e" target="_blank">How to rewrite your SQL queries in Pandas, and more</a><a class="anchor-link" href="#How-to-rewrite-your-SQL-queries-in-Pandas,-and-more">¶</a>
</h2>
<center>
<a href="https://codeburst.io/how-to-rewrite-your-sql-queries-in-pandas-and-more-149d341fc53e" target="_blank">
<img src="https://leemeng.tw/images/digests/kofu-pandas.jpeg"/>
</a>
<br/>
</center>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>提供常見的 SQL 查詢以及其對應的 Pandas 寫法。一個有效率的資料科學家通常需要 SQL 及 pandas 兼具。雖然這篇一開始的目標讀者是那些已經熟悉 SQL 並打算使用 Pandas 的讀者,我認為熟悉 Pandas 但還不了解 SQL 的同學們也能從這篇學到點東西。</p>
<p>這篇適合至少懂 Python 或是 SQL 並想學習另外一個語言的讀者。如果你想要深入了解 SQL 或是其與 Python 之間的差異,你可以看看我之前寫的<a href="https://leemengtaiwan.github.io/why-you-need-to-learn-sql-as-a-data-scientist.html">為何資料科學家需要學習 SQL</a>。</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Learn-Functional-Python-in-10-Minutes">
<a href="https://hackernoon.com/learn-functional-python-in-10-minutes-to-2d1651dece6f" target="_blank">Learn Functional Python in 10 Minutes</a><a class="anchor-link" href="#Learn-Functional-Python-in-10-Minutes">¶</a>
</h2>
<center>
<a href="https://hackernoon.com/learn-functional-python-in-10-minutes-to-2d1651dece6f" target="_blank">
<img src="https://leemeng.tw/images/digests/1_ZXixptvL4rzkx3EDuj38xw.jpg"/>
</a>
<br/>
</center>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><a href="https://bobbywlindsey.com/data-science/2018/07/16/docker-for-data-scientists/">這篇 Hackernon 文章</a>則簡單介紹 Functional Programming 在 Python 可以如何被實作,函式(function)是怎麼被視為 Python 的第一公民以及我們能如何活用函式如 Map、Filter 函式。</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>如果你剛起步,想要有效率地學習 Python 的話,我建議可以從 <a href="https://www.python-course.eu/list_comprehension.php">List comprehension</a> 開始學起。</p>
<p>一個簡單的例子是假設我們想從一個 List 中取得大於 50 的數字:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class="highlight hl-ipython3"><pre><span></span><span class="n">l</span> <span class="o">=</span> <span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> <span class="mi">70</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span>
<span class="n">larger_than_50</span> <span class="o">=</span> <span class="p">[</span><span class="n">e</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">l</span> <span class="k">if</span> <span class="n">e</span> <span class="o">></span> <span class="mi">50</span><span class="p">]</span>
<span class="nb">print</span><span class="p">(</span><span class="n">larger_than_50</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_subarea output_stream output_stdout output_text">
<pre>[100, 70]
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>文章的後半段則透過 The Zen of Python (Python 的禪學)來說明為何使用 List comprehension 會比使用傳統 Functional Programming 中的 Map、Filter 函式來得簡單。</p>
<p>Python 有一個著名的彩蛋,你可以利用 <code>import this</code> 來顯示 The Zen of Python,它提供使用 Python 的人一個簡單的開發準則,具體如下:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class="highlight hl-ipython3"><pre><span></span><span class="kn">import</span> <span class="nn">this</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_subarea output_stream output_stdout output_text">
<pre>The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Docker-for-Data-Scientists">
<a href="https://bobbywlindsey.com/data-science/2018/07/16/docker-for-data-scientists/" target="_blank">Docker for Data Scientists</a><a class="anchor-link" href="#Docker-for-Data-Scientists">¶</a>
</h2>
<center>
<a href="https://bobbywlindsey.com/data-science/2018/07/16/docker-for-data-scientists/" target="_blank">
<img src="https://leemeng.tw/images/digests/docker-flickr.jpg"/>
</a>
<br/>
</center>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>很簡單地說明常見的 <a href="https://www.docker.com/">Docker</a> 術語以及使用 Docker 可以為資料科學家帶來的好處:</p>
<ul>
<li>節省建置開發 / 分析環境所需的時間</li>
<li>增加可重現性(Reproducibility)</li>
<li>抽象化作業系統(OS)的概念,再也沒有只能在 Mac 跑而不能在 Windows 跑的問題</li>
</ul>
<p>這篇提供非常初級的指令來開始在本機環境使用 Docker,可以嘗試看看。</p>
<p>在 Smartnews 我則是使用 <a href="https://aws.amazon.com/tw/ecs/">Amazon Elastic Container Service</a> 來快速部署一些資料科學家們常會用到的分析工具,如大家的好朋友 <a href="https://jupyterhub.readthedocs.io/en/stable/">Jupyter Hub</a>、Airbnb 開發的 BI 工具 <a href="https://github.com/apache/incubator-superset">Superset</a>。之後有機會會另外撰文分享經驗。</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="Try-It-Yourself">Try It Yourself<a class="anchor-link" href="#Try-It-Yourself">¶</a></h3><p>Docker 讓我們可以快速重現其他人的分析環境或者是有趣的 application。如果你想馬上感受 Docker 的威力,可以看看我之前利用 <a href="https://www.tensorflow.org/">Tensorflow</a> 以及 <a href="http://flask.pocoo.org/">Flask</a> 實作的一個貓咪圖片辨識的 <a href="https://github.com/leemengtaiwan/cat-recognition-app">Github repo</a>(feat. <a href="https://github.com/mnicnc404">CNC</a>):</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<center>
<img src="https://leemeng.tw/images/digests/cat-recog-cover.jpg" style="width:80%;"/>
</center>
<center>
利用 Tensorflow, Flask 實作 App 並使用 Docker 快速與他人分享成果
(圖片來源:<a href="https://github.com/leemengtaiwan/cat-recognition-app" target="_blank">Cat Recognizer</a>)
<br/>
<br/>
</center>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>雖然 <a href="https://github.com/leemengtaiwan/cat-recognition-app">Github repo</a> 上也有教學指南,想要最快速地在你的電腦上使用這個 App 的話,下載 <a href="https://www.docker.com/">Docker</a> 並開啟 Daemon 後,使用命令列輸入以下指令:</p>
<div class="highlight"><pre><span></span>docker<span class="w"> </span>pull<span class="w"> </span>leemeng/cat
docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>-p<span class="w"> </span><span class="m">2468</span>:5000<span class="w"> </span>leemeng/cat
</pre></div>
<p>接著在瀏覽器輸入 <code>localhost:2468</code> 應該就能開始使用了。如果你想多了解點 Docker,可以參考我寫的<a href="https://leemeng.tw/3-ways-you-can-leverage-the-power-of-docker-in-data-science-part-1-learn-the-basic.html">給資料科學家的 Docker 指南:3 種活用 Docker 的方式(上)</a>。</p>
<p>不過現在讓我們繼續看剩下的 2 篇好文章:)</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="The-Democratization-of-Data-Science_1">
<a href="https://hbr.org/2018/07/the-democratization-of-data-science" target="_blank">The Democratization of Data Science</a><a class="anchor-link" href="#The-Democratization-of-Data-Science">¶</a>
</h2>
<center>
<a href="https://hbr.org/2018/07/the-democratization-of-data-science" target="_blank">
<img src="https://leemeng.tw/images/digests/jul18-27-833771544-Patricia-Toth-McCormick-1200x675.jpg"/>
</a>
<br/>
</center>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><a href="https://hbr.org/">哈佛商業評論(Harvard Business Review, HBR)</a>在這篇文章裏頭敘述為何不只是針對資料科學家,提升所有人的「資料素養」對一個企業來說是一件非常重要的事情。</p>
<p>最明顯的優點是可以讓數據團隊專注在:</p>
<ul>
<li>解決更高層次的企業問題</li>
<li>建立分析工具以加速所有部門的數據分析</li>
</ul>
<p>而不是處理每個部門的「資料瑣事」。</p>
<p>這個議題並非只跟企業的管理階層相關。對一個資料科學家來說,想辦法利用資料工程(Data Engineering)等方式來自動化如「建立簡單儀表板」的工作,並教導各個部門實際的使用方式,可以讓你一勞永逸,避免永遠在處理非常瑣碎的「資料瑣事」,專著在更大的目標。</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>!quote
-你不會因為自己不是會計師就不遵守專案預算;你也不會因為不是資料科學家就不提升資料素養。</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Data's-day-of-reckoning">
<a href="https://www.oreilly.com/ideas/datas-day-of-reckoning" target="_blank">Data's day of reckoning</a><a class="anchor-link" href="#Data's-day-of-reckoning">¶</a>
</h2>
<center>
<a href="https://www.oreilly.com/ideas/datas-day-of-reckoning" target="_blank">
<img src="https://leemeng.tw/images/digests/shower-of-sparks-3115784_1280.jpg"/>
</a>
<br/>
</center>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>生活在數據驅動時代的我們或許都能感受到世界變化的快速。</p>
<p>美國前首席資料科學家 <a href="https://www.oreilly.com/people/15b77-dj-patil">DJ Patil</a> 認為不管是資料科學、機器學習還是人工智慧領域,「道德倫理」以及「安全隱私」議題都應該越來越被重視。</p>
<p>電腦科學(Computer Science)時代最著名的安全議題非 SQL 注入<a href="https://zh.wikipedia.org/zh-hant/SQL%E8%B3%87%E6%96%99%E9%9A%B1%E7%A2%BC%E6%94%BB%E6%93%8A">(SQL Injection)</a>莫屬了。如同這個議題,在數據驅動時代,我們也會面臨類似道德以及數據保護的議題,像是人工智慧模型產生具有偏見的預測、以及最近的 <a href="https://zh.wikipedia.org/wiki/%E6%AD%90%E7%9B%9F%E4%B8%80%E8%88%AC%E8%B3%87%E6%96%99%E4%BF%9D%E8%AD%B7%E8%A6%8F%E7%AF%84">GDPR</a> 等等。</p>
<p>在教育方面,DJ Patil 認為我們應該教育下一代在數據處理時,應該遵守的準則並將其被納入課綱;以數據驅動的公司則需要將這些想法都納入企業文化,在招聘資料科學家的時候,除了考慮他 / 她的分析能力以外,也要評估道德倫理的部分。</p>
<p>身為一個資料科學家,除了技術層面的提升,也應該稍微了解這些議題。</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<blockquote>
<p>
We can build a future we want to live in, or we can build a nightmare. The choice is up to us.
<br/>
<br/>
</p>
</blockquote>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="結語">結語<a class="anchor-link" href="#結語">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Pandas、SQL、Docker、資料素養的培養以及數據時代的道德倫理問題等等,這週我們也看了不少資料科學相關的文章,希望你有從這篇文章裡頭學到點東西。</p>
<p>雖然因為篇幅關係沒辦法把所有實際的 Python 指令列在這邊,我希望透過摘要的方式能讓沒時間的你也能學習、初步地了解資料科學並進一步發現自己有興趣的地方鑽研。</p>
<p>有時間的話我推薦實際閱讀這些文章(當然也可以閱讀其他你自己收藏的文章,也歡迎分享),也可以試試看我寫的 <a href="https://github.com/leemengtaiwan/cat-recognition-app">Cat Recognizer</a> 並留言跟我說說你的想法。</p>
<p>之後一樣會定期更新,希望收到第一手消息的話可以點擊下面的訂閱。另外如果你有其他會對這篇文章有興趣的朋友,也請幫忙分享給他 / 她:)</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>That's it for this week, stay tuned and happy data science!</p>
</div>
</div>
</div>
<script type="text/javascript">if (!document.getElementById('mathjaxscript_pelican_#%@#$@#')) {
var mathjaxscript = document.createElement('script');
mathjaxscript.id = 'mathjaxscript_pelican_#%@#$@#';
mathjaxscript.type = 'text/javascript';
mathjaxscript.src = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
mathjaxscript[(window.opera ? "innerHTML" : "text")] =
"MathJax.Hub.Config({" +
" config: ['MMLorHTML.js']," +
" TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } }," +
" jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
" extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
" displayAlign: 'center'," +
" displayIndent: '0em'," +
" showMathMenu: true," +
" tex2jax: { " +
" inlineMath: [ ['$','$'] ], " +
" displayMath: [ ['$$','$$'] ]," +
" processEscapes: true," +
" preview: 'TeX'," +
" }, " +
" 'HTML-CSS': { " +
" linebreaks: { automatic: true, width: '95% container' }, " +
" styles: { '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {color: 'black ! important'} }" +
" } " +
"}); ";
(document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
}
</script>
<!-- Tags -->
<p class="blog-content__tags">
<span>Post Tags</span>
<span class="blog-content__tag-list">
<a href="https://leemeng.tw/tag/wen-zhai.html" rel="tag">文摘</a>
<a href="https://leemeng.tw/tag/pandas.html" rel="tag">Pandas</a>
<a href="https://leemeng.tw/tag/sql.html" rel="tag">SQL</a>
<a href="https://leemeng.tw/tag/docker.html" rel="tag">Docker</a>
<a href="https://leemeng.tw/tag/zi-liao-ke-xue.html" rel="tag">資料科學</a>
</span>
</p>
<!-- end Tags -->
<!-- Mail-list-subscribe -->
<div id="article-inner-subscribe" class="blog-content__pagenav">
<div class="blog-content__nav">
<div class="blog-content__prev">
<a class="open-popup" rel="subscribe">
<span>Get Latest Arrivals</span>
訂閱最新文章
</a>
</div>
<div class="blog-content__next">
<p>
跟資料科學相關的最新文章直接送到家。</br>
只要加入訂閱名單,當新文章出爐時,</br>
你將能馬上收到通知 <i class="im im-newspaper-o" aria-hidden="true"></i>
</p>
</div>
</div>
<div class="blog-content__all">
<a class="open-popup btn btn--primary "> Subscribe </a>
</div>
</div>
<!-- end Mail-list-subscribe -->
<!--Pagination-->
<div id="article-inner-neighbor-pages" class="blog-content__pagenav">
<div class="blog-content__nav">
<div class="blog-content__prev">
<a href="https://leemeng.tw/a-story-about-airflow-and-data-engineering-using-how-to-use-python-to-catch-up-with-latest-comics-as-an-example.html" rel="prev">
<span>Previous Post</span>
一段 Airflow 與資料工程的故事:談如何用 Python 追漫畫連載
</a>
</div>
<div class="blog-content__next">
<a href="https://leemeng.tw/data-science-digest-volume-2.html" rel="next">
<span>Next Post</span>
資料科學文摘 Vol.2 產品理解以及 DS / DE 之路
</a>
</div>
</div>
<div class="blog-content__all">
<a href="blog.html" class="btn btn--primary">
View All Post
</a>
</div>
</div>
<!-- end Pagination-->
</div><!-- end blog-content__main -->
</div>
</div> <!-- end blog-content -->
</article>
<div class="comments-wrap">
<div id="comments" class="row">
<div class="col-full">
<div id="disqus_thread"></div>
</div>
</div>
</div>
<script type="text/javascript">
var disqus_shortname = 'leemengtaiwan';
var disqus_title = '資料科學文摘 Vol.3 Pandas、Docker 以及數據時代的反思';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<!-- footer
================================================== -->
<footer style="background:#0a0809">
<div class="row">
<div class="col-full">
<div class="footer-logo">
<a class="footer-site-logo" href="#0"><img src="https://leemeng.tw/theme/images/logo.png" alt="Homepage"></a>
</div>
<ul class="footer-social">
<li><a href="https://github.com/leemengtaiwan" target="_blank">
<i class="im im-github" aria-hidden="true"></i>
<span>Github</span>
</a></li>
<li><a href="https://www.facebook.com/LeeMengTaiwan" target="_blank">
<i class="im im-facebook" aria-hidden="true"></i>
<span>Facebook</span>
</a></li>
<li><a href="https://www.instagram.com/leemengtaiwan/" target="_blank">
<i class="im im-instagram" aria-hidden="true"></i>
<span>Instagram</span>
</a></li>
<li><a href="https://www.linkedin.com/in/leemeng1990/" target="_blank">
<i class="im im-linkedin" aria-hidden="true"></i>
<span>LinkedIn</span>
</a></li> </ul>
</div>
</div>
<div class="row footer-bottom">
<div class="col-twelve">
<div class="go-top">
<a class="smoothscroll" title="Back to Top" href="#top"><i class="im im-arrow-up" aria-hidden="true"></i></a>
</div>
</div>
</div> <!-- end footer-bottom -->
</footer> <!-- end footer -->
<!-- Javascript
================================================== -->
<script src="https://leemeng.tw/theme/js/jquery-3.2.1.min.js"></script>
<script src="https://leemeng.tw/theme/js/plugins.js"></script>
<script src="https://leemeng.tw/theme/js/main_raw.js"></script>
<script type='text/javascript' src='https://leemeng.tw/theme/js/scroll-detect.js'></script>
<!--https://instant.page/-->
<script src="//instant.page/1.0.0" type="module" integrity="sha384-6w2SekMzCkuMQ9sEbq0cLviD/yR2HfA/+ekmKiBnFlsoSvb/VmQFSi/umVShadQI"></script>
<script type='text/javascript' src='https://leemeng.tw/theme/js/progress-bar.js'></script>
<script type='text/javascript' src='https://leemeng.tw/theme/js/scroll-detect.js'></script>
<!--show and hide left navigation by scrolling-->
<script>
$(document).scroll(function() {
var y = $(this).scrollTop();
if ( $(window).width() > 980 ) {
if (y > 600) {
$('#left-navigation').fadeIn(300);
} else {
$('#left-navigation').fadeOut(300);
}
}
});
</script>
<!--reference: https://gist.github.com/scottmagdalein/259d878ad46ed6f2cdce-->
<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false">
</script>
<script type="text/javascript">
function showMailingPopUp() {
require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us18.list-manage.com","uuid":"151cb59f2de814c499c76b77a","lid":"dd1d78cc5e"})})
document.cookie = "MCPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
document.cookie = "MCPopupSubscribed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
};
$(function() {
$(".open-popup").on('click', function() {
showMailingPopUp();
});
});
</script><!--https://darkmodejs.learn.uno/-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script>
<script>
var options = {
bottom: '32px', // default: '32px'
right: 'unset', // default: '32px'
left: '32px', // default: 'unset'
time: '0.2s', // default: '0.3s'
mixColor: '#fff', // default: '#fff'
backgroundColor: '#fff', // default: '#fff'
buttonColorDark: '#100f2c', // default: '#100f2c'
buttonColorLight: '#fff', // default: '#fff'
saveInCookies: true, // default: true,
label: '🌓', // default: ''
autoMatchOsTheme: true // default: true
}
const darkmode = new Darkmode(options);
darkmode.showWidget();
</script>
<!--reference: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_overlay-->
<script>
function openTocNav() {
document.getElementById("tocNav").style.width = "100%";
}
function closeTocNav() {
document.getElementById("tocNav").style.width = "0%";
}
function toggleTocNav() {
var current_width = document.getElementById("tocNav").style.width;
if (current_width == "100%") {
document.getElementById("tocNav").style.width = "0%";
} else {
document.getElementById("tocNav").style.width = "100%";
}
}
function closeLeftNavImage(elementId) {
document.getElementById(elementId).style.width = "0%";
}
function toggleLeftNavImage(elementId) {
var current_width = document.getElementById(elementId).style.width;
if (current_width == "100%") {
document.getElementById(elementId).style.width = "0%";
} else {
document.getElementById(elementId).style.width = "100%";
}
}
</script>
</body>
</html>