added 2 articles

This commit is contained in:
Guillaume 2019-11-25 21:39:34 +01:00
parent 258c452cdd
commit c36ebae7b2
128 changed files with 9183 additions and 8714 deletions

View File

@ -185,7 +185,7 @@ For a continuous probability distribution, the median is the value such that a n
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -219,7 +219,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -429,7 +429,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -256,7 +256,7 @@ we call B the event "a blue ball is drawn" and R the event "a red ball is drawn"
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -311,7 +311,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -331,7 +331,7 @@ Between 20 and 22 hours?</p>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -270,7 +270,7 @@ The total number of tickets bought follows a normal distribution of mean <span c
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -272,7 +272,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -277,7 +277,7 @@ $$</div>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -275,7 +275,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -286,7 +286,7 @@ maxuploadtarget=5000
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -161,7 +161,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -365,7 +365,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -279,7 +279,7 @@ Let's first import some libraries</p>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -161,7 +161,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -149,7 +149,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -152,7 +152,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -154,7 +154,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -235,7 +235,7 @@ Let's first import some libraries</p>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -280,7 +280,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -444,6 +444,7 @@
</div>
<div class="panel-body">
<ul>
<li><a href="./python/load_image_PIL.html">Open an image with PIL</a></li>
<li><a href="./python/point_cloud_distance.html">Get min and max distance withing a point cloud</a></li>
<li><a href="./python/numpy_save.html">Save a numpy array to disk</a></li>
<li><a href="./python/select_lines_values_list.html">Filter or select lines of a DataFrame containing values in a list</a></li>
@ -581,6 +582,7 @@
</div>
<div class="panel-body">
<ul>
<li><a href="./linux/md5_recursif.html">Recursively compute md5 checksum</a></li>
<li><a href="./linux/sed.html">Basic operations with SED</a></li>
<li><a href="./linux/ramdisk.html">How to create a ramdisk?</a></li>
<li><a href="./linux/simple_bash_function.html">Create a simple bash function</a></li>
@ -743,7 +745,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -149,7 +149,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -211,7 +211,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -144,7 +144,7 @@ However, you can use the following command to do it </p>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -143,7 +143,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -203,7 +203,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -148,7 +148,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -167,7 +167,7 @@ none 0 0 0 - /config
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -256,7 +256,7 @@ wifi0 Link encap:UNSPEC HWaddr 5C-51-4F-41-7A-AD-00-00-00-00-00-00-00-00-00
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -172,7 +172,7 @@ USER;PID;%CPU;%MEM;VSZ;RSS;TTY;STAT;START;TIME;COMMAND</p>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

192
linux/md5_recursif.html Normal file
View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Data Science for Political and Social Phenomena">
<meta name="author" content="Guillaume Redoulès">
<link rel="icon" href="../favicon.ico">
<title>Recursively compute md5 checksum - Linux</title>
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="../theme/js/jquery.min.js"><\/script>')
</script>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="../theme/css/bootstrap.css" />
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" type="text/css" href="../theme/css/ie10-viewport-bug-workaround.css" />
<!-- Custom styles for this template -->
<link rel="stylesheet" type="text/css" href="../theme/css/style.css" />
<link rel="stylesheet" type="text/css" href="../theme/css/notebooks.css" />
<link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700|Roboto:400,500,700' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="tags" content="Bash" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="..">Guillaume Redoulès</a>
</div>
<div class="navbar-collapse collapse" id="searchbar">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">About<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../pages/about.html">About Guillaume</a></li>
<li><a href="https://github.com/redoules">GitHub</a></li>
<li><a href="https://www.linkedin.com/in/guillaume-redoul%C3%A8s-33923860/">LinkedIn</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Data Science<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="..#Blog">Blog</a></li>
<li><a href="..#Python">Python</a></li>
<li><a href="..#Bash">Bash</a></li>
<li><a href="..#SQL">SQL</a></li>
<li><a href="..#Mathematics">Mathematics</a></li>
<li><a href="..#Machine_Learning">Machine Learning</a></li>
<li><a href="..#Projects">Projects</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Projects<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/redoules/redoules.github.io">Notes (Github)</a></li>
</ul>
</li>
<!--<li class="dropdown">
<a href="../feeds/blog.rss.xml">Blog RSS</a>
</li>-->
</ul>
<form class="navbar-form" action="../search.html" onsubmit="return validateForm(this.elements['q'].value);">
<div class="form-group" style="display:inline;">
<div class="input-group" style="display:table;">
<span class="input-group-addon" style="width:1%;"><span class="glyphicon glyphicon-search"></span></span>
<input class="form-control search-query" name="q" id="tipue_search_input" placeholder="e.g. scikit KNN, pandas merge" required autocomplete="off" type="text">
</div>
</div>
</form>
</div>
<!--/.nav-collapse -->
</div>
</div>
<!-- end of header section -->
<div class="container">
<!-- <div class="alert alert-warning" role="alert">
Did you find this page useful? Please do me a quick favor and <a href="#" class="alert-link">endorse me for data science on LinkedIn</a>.
</div> -->
<section id="content" class="body">
<header>
<h1>
Recursively compute md5 checksum
</h1>
<ol class="breadcrumb">
<li>
<time class="published" datetime="2019-11-21T09:26:00+01:00">
21 novembre 2019
</time>
</li>
<li>Linux</li>
<li>Bash</li>
</ol>
</header>
<div class='article_content'>
<p>The md5 checksum for all files in a folder can be recursively computed then stored in a text file called md5sum.txt with the command :*</p>
<div class="highlight"><pre><span></span><span class="nb">cd</span> /you/folder/of/interest
find -type f <span class="se">\(</span> -not -name <span class="s2">&quot;md5sum.txt&quot;</span> <span class="se">\)</span> -exec md5sum <span class="s1">&#39;{}&#39;</span> <span class="se">\;</span> &gt; md5sum.txt
</pre></div>
</div>
<aside>
<div class="bug-reporting__panel">
<h3>Find an error or bug? Have a suggestion?</h3>
<p>Everything on this site is avaliable on GitHub. Head on over and <a href='https://github.com/redoules/redoules.github.io/issues/new'>submit an issue.</a> You can also message me directly by <a href='mailto:guillaume.redoules@gadz.org'>email</a>.</p>
</div>
</aside>
</section>
</div>
<!-- start of footer section -->
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.
</center>
</p>
</div>
</footer>
<!-- This jQuery line finds any span that contains code highlighting classes and then selects the parent <pre> tag and adds a border. This is done as a workaround to visually distinguish the code inputs and outputs -->
<script>
$( ".hll, .n, .c, .err, .k, .o, .cm, .cp, .c1, .cs, .gd, .ge, .gr, .gh, .gi, .go, .gp, .gs, .gu, .gt, .kc, .kd, .kn, .kp, .kr, .kt, .m, .s, .na, .nb, .nc, .no, .nd, .ni, .ne, .nf, .nl, .nn, .nt, .nv, .ow, .w, .mf, .mh, .mi, .mo, .sb, .sc, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .bp, .vc, .vg, .vi, .il" ).parent( "pre" ).css( "border", "1px solid #DEDEDE" );
</script>
<!-- Load Google Analytics -->
<script>
/*
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-66582-32', 'auto');
ga('send', 'pageview');
*/
</script>
<!-- End of Google Analytics -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../theme/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../theme/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>

View File

@ -158,7 +158,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -169,7 +169,7 @@ dd <span class="k">if</span><span class="o">=</span>/dev/zero <span class="nv">o
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -494,7 +494,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -151,7 +151,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -208,7 +208,7 @@ The secret number is 126
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -160,7 +160,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -234,7 +234,7 @@ Where :</p>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -176,7 +176,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -248,7 +248,7 @@ b_2\\
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -196,7 +196,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -256,7 +256,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -233,7 +233,7 @@ So :
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -214,7 +214,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -195,7 +195,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -203,7 +203,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -197,7 +197,7 @@ and B are considered to be independent if event A has no effect on the probabili
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -221,7 +221,7 @@ where <span class="math">\(erf\)</span> is the error function:
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -206,7 +206,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -222,7 +222,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -223,7 +223,7 @@ $$</div>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -145,7 +145,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -524,7 +524,7 @@ And we do the same for he 10 points that minimize time for user 2, color them is
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -192,7 +192,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -241,7 +241,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -235,7 +235,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -378,7 +378,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -168,7 +168,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -192,7 +192,7 @@ If you try to open a non existing file in read mode 'r', a FileNotFoundError wil
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -176,7 +176,7 @@ conda install numpy --channel intel --override-channels
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -208,7 +208,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -237,7 +237,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -186,7 +186,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -171,7 +171,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -339,7 +339,7 @@ However, exporting to a sql database can prove very useful. Indeed, having a wel
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -146,7 +146,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -165,7 +165,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -160,7 +160,7 @@ myvariable: 42
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -169,7 +169,7 @@ myvariable: 42
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -181,7 +181,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -338,7 +338,7 @@ http://127.0.0.1:8787/status</p>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -148,7 +148,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -232,7 +232,7 @@ The list of dependencies required to test, build and generate the doc are listed
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -164,7 +164,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -218,7 +218,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -177,7 +177,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -151,7 +151,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -158,7 +158,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -158,7 +158,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -213,7 +213,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -217,7 +217,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

261
python/load_image_PIL.html Normal file
View File

@ -0,0 +1,261 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Data Science for Political and Social Phenomena">
<meta name="author" content="Guillaume Redoulès">
<link rel="icon" href="../favicon.ico">
<title>Open an image with PIL - Python</title>
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="../theme/js/jquery.min.js"><\/script>')
</script>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="../theme/css/bootstrap.css" />
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" type="text/css" href="../theme/css/ie10-viewport-bug-workaround.css" />
<!-- Custom styles for this template -->
<link rel="stylesheet" type="text/css" href="../theme/css/style.css" />
<link rel="stylesheet" type="text/css" href="../theme/css/notebooks.css" />
<link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700|Roboto:400,500,700' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="tags" content="Data Wrangling" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="..">Guillaume Redoulès</a>
</div>
<div class="navbar-collapse collapse" id="searchbar">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">About<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../pages/about.html">About Guillaume</a></li>
<li><a href="https://github.com/redoules">GitHub</a></li>
<li><a href="https://www.linkedin.com/in/guillaume-redoul%C3%A8s-33923860/">LinkedIn</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Data Science<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="..#Blog">Blog</a></li>
<li><a href="..#Python">Python</a></li>
<li><a href="..#Bash">Bash</a></li>
<li><a href="..#SQL">SQL</a></li>
<li><a href="..#Mathematics">Mathematics</a></li>
<li><a href="..#Machine_Learning">Machine Learning</a></li>
<li><a href="..#Projects">Projects</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Projects<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/redoules/redoules.github.io">Notes (Github)</a></li>
</ul>
</li>
<!--<li class="dropdown">
<a href="../feeds/blog.rss.xml">Blog RSS</a>
</li>-->
</ul>
<form class="navbar-form" action="../search.html" onsubmit="return validateForm(this.elements['q'].value);">
<div class="form-group" style="display:inline;">
<div class="input-group" style="display:table;">
<span class="input-group-addon" style="width:1%;"><span class="glyphicon glyphicon-search"></span></span>
<input class="form-control search-query" name="q" id="tipue_search_input" placeholder="e.g. scikit KNN, pandas merge" required autocomplete="off" type="text">
</div>
</div>
</form>
</div>
<!--/.nav-collapse -->
</div>
</div>
<!-- end of header section -->
<div class="container">
<!-- <div class="alert alert-warning" role="alert">
Did you find this page useful? Please do me a quick favor and <a href="#" class="alert-link">endorse me for data science on LinkedIn</a>.
</div> -->
<section id="content" class="body">
<header>
<h1>
Open an image with PIL
</h1>
<ol class="breadcrumb">
<li>
<time class="published" datetime="2019-11-21T10:21:00+01:00">
21 novembre 2019
</time>
</li>
<li>Python</li>
<li>Data Wrangling</li>
</ol>
</header>
<div class='article_content'>
<p>Python has a library called PIL (short for Python Image Library). With openCV, it provides a very useful set of objects to manipulate image data.</p>
<p>In order to read the content of an image, we will create an <code>Image</code> object</p>
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">PIL</span> <span class="kn">import</span> <span class="n">Image</span>
</pre></div>
<p>We now need to specify the image filename as an argument of the open function</p>
<div class="highlight"><pre><span></span><span class="n">img</span> <span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s2">&quot;../images/load_image_PIL/myimage.png&quot;</span><span class="p">)</span>
</pre></div>
<p>If you are in the notebook, you can display the image by calling the object you just created </p>
<div class="highlight"><pre><span></span><span class="n">img</span>
</pre></div>
<p><img alt="png" src="../images/load_image_PIL/myimage.png"></p>
<p>If you pass the image object to the constructor of a Numpy array, the values of the image will be stored in that array</p>
<div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
<span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
</pre></div>
<div class="highlight"><pre><span></span><span class="nb">array</span><span class="p">([[[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">...,</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">]],</span>
<span class="p">[[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">...,</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">]],</span>
<span class="p">[[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">...,</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">]],</span>
<span class="p">...,</span>
<span class="p">[[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">...,</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">]],</span>
<span class="p">[[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">...,</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">]],</span>
<span class="p">[[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">...,</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">],</span>
<span class="p">[</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">]]],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">uint8</span><span class="p">)</span>
</pre></div>
</div>
<aside>
<div class="bug-reporting__panel">
<h3>Find an error or bug? Have a suggestion?</h3>
<p>Everything on this site is avaliable on GitHub. Head on over and <a href='https://github.com/redoules/redoules.github.io/issues/new'>submit an issue.</a> You can also message me directly by <a href='mailto:guillaume.redoules@gadz.org'>email</a>.</p>
</div>
</aside>
</section>
</div>
<!-- start of footer section -->
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.
</center>
</p>
</div>
</footer>
<!-- This jQuery line finds any span that contains code highlighting classes and then selects the parent <pre> tag and adds a border. This is done as a workaround to visually distinguish the code inputs and outputs -->
<script>
$( ".hll, .n, .c, .err, .k, .o, .cm, .cp, .c1, .cs, .gd, .ge, .gr, .gh, .gi, .go, .gp, .gs, .gu, .gt, .kc, .kd, .kn, .kp, .kr, .kt, .m, .s, .na, .nb, .nc, .no, .nd, .ni, .ne, .nf, .nl, .nn, .nt, .nv, .ow, .w, .mf, .mh, .mi, .mo, .sb, .sc, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .bp, .vc, .vg, .vi, .il" ).parent( "pre" ).css( "border", "1px solid #DEDEDE" );
</script>
<!-- Load Google Analytics -->
<script>
/*
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-66582-32', 'auto');
ga('send', 'pageview');
*/
</script>
<!-- End of Google Analytics -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../theme/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../theme/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>

View File

@ -248,7 +248,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -188,7 +188,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -149,7 +149,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -164,7 +164,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -181,7 +181,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -202,7 +202,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -237,7 +237,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -156,7 +156,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -647,7 +647,7 @@ you also need to specify the axis.</p>
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -173,7 +173,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -288,7 +288,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -359,7 +359,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -316,7 +316,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -192,7 +192,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

View File

@ -381,7 +381,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 103 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<center>This project contains 105 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.

Some files were not shown because too many files have changed in this diff Show More