|
32 | 32 | <link rel="stylesheet" type="text/css" href="../_static/styles/sphinx-book-theme.css?v=eba8b062" /> |
33 | 33 | <link rel="stylesheet" type="text/css" href="../_static/togglebutton.css?v=13237357" /> |
34 | 34 | <link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" /> |
35 | | - <link rel="stylesheet" type="text/css" href="../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" /> |
| 35 | + <link rel="stylesheet" type="text/css" href="../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css?v=be8a1c11" /> |
36 | 36 | <link rel="stylesheet" type="text/css" href="../_static/sphinx-thebe.css?v=4fa983c6" /> |
37 | 37 | <link rel="stylesheet" type="text/css" href="../_static/sphinx-design.min.css?v=95c83b7e" /> |
38 | 38 |
|
|
210 | 210 | <ul class="nav bd-sidenav bd-sidenav__home-link"> |
211 | 211 | <li class="toctree-l1"> |
212 | 212 | <a class="reference internal" href="../README.html"> |
213 | | - What Should You Expect From This Book? |
| 213 | + Efficient Python Tricks and Tools for Data Scientists |
214 | 214 | </a> |
215 | 215 | </li> |
216 | 216 | </ul> |
@@ -634,12 +634,10 @@ <h2> Contents </h2> |
634 | 634 | </li> |
635 | 635 | <li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#work-with-functions">3.10. Work with Functions</a><ul class="visible nav section-nav flex-column"> |
636 | 636 | <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#execute-a-function-n-times">3.10.1. Execute a Function n Times</a></li> |
637 | | -<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#chaining">3.10.2. Chaining</a><ul class="nav section-nav flex-column"> |
638 | | -<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#pydashs-methods">3.10.2.1. Pydash’s Methods</a></li> |
639 | | -<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#customized-methods">3.10.2.2. Customized Methods</a></li> |
640 | | -<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#planting-a-value">3.10.2.3. Planting a Value</a></li> |
641 | | -</ul> |
642 | | -</li> |
| 637 | +<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#chaining">3.10.2. Chaining</a></li> |
| 638 | +<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#pydashs-methods">3.10.3. Pydash’s Methods</a></li> |
| 639 | +<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#customized-methods">3.10.4. Customized Methods</a></li> |
| 640 | +<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#planting-a-value">3.10.5. Planting a Value</a></li> |
643 | 641 | </ul> |
644 | 642 | </li> |
645 | 643 | </ul> |
@@ -1103,8 +1101,9 @@ <h2><span class="section-number">3.10.1. </span>Execute a Function n Times<a cla |
1103 | 1101 | </section> |
1104 | 1102 | <section id="chaining"> |
1105 | 1103 | <h2><span class="section-number">3.10.2. </span>Chaining<a class="headerlink" href="#chaining" title="Link to this heading">#</a></h2> |
| 1104 | +</section> |
1106 | 1105 | <section id="pydashs-methods"> |
1107 | | -<h3><span class="section-number">3.10.2.1. </span>Pydash’s Methods<a class="headerlink" href="#pydashs-methods" title="Link to this heading">#</a></h3> |
| 1106 | +<h2><span class="section-number">3.10.3. </span>Pydash’s Methods<a class="headerlink" href="#pydashs-methods" title="Link to this heading">#</a></h2> |
1108 | 1107 | <p>Sometimes you might want to apply several methods to an object. Instead of writing several lines of code, can you apply all methods at once?</p> |
1109 | 1108 | <p>That is when method chaining comes in handy. To apply method chaining in an object, use the <code class="docutils literal notranslate"><span class="pre">chain</span></code> method:</p> |
1110 | 1109 | <div class="cell docutils container"> |
@@ -1195,7 +1194,7 @@ <h3><span class="section-number">3.10.2.1. </span>Pydash’s Methods<a class="he |
1195 | 1194 | <p>This is called <a class="reference external" href="https://www.tutorialspoint.com/functional_programming/functional_programming_lazy_evaluation.htm">lazy evaluation</a>. Lazy evaluation holds the evaluation of an expression until its value is needed, which avoids repeated evaluation.</p> |
1196 | 1195 | </section> |
1197 | 1196 | <section id="customized-methods"> |
1198 | | -<h3><span class="section-number">3.10.2.2. </span>Customized Methods<a class="headerlink" href="#customized-methods" title="Link to this heading">#</a></h3> |
| 1197 | +<h2><span class="section-number">3.10.4. </span>Customized Methods<a class="headerlink" href="#customized-methods" title="Link to this heading">#</a></h2> |
1199 | 1198 | <p>If you want to use your own methods instead of pydash’s methods, use the <code class="docutils literal notranslate"><span class="pre">map</span></code> method:</p> |
1200 | 1199 | <div class="cell docutils container"> |
1201 | 1200 | <div class="cell_input docutils container"> |
@@ -1253,7 +1252,7 @@ <h3><span class="section-number">3.10.2.2. </span>Customized Methods<a class="he |
1253 | 1252 | </div> |
1254 | 1253 | </section> |
1255 | 1254 | <section id="planting-a-value"> |
1256 | | -<h3><span class="section-number">3.10.2.3. </span>Planting a Value<a class="headerlink" href="#planting-a-value" title="Link to this heading">#</a></h3> |
| 1255 | +<h2><span class="section-number">3.10.5. </span>Planting a Value<a class="headerlink" href="#planting-a-value" title="Link to this heading">#</a></h2> |
1257 | 1256 | <p>To replace the initial value of a chain with another value, use the <code class="docutils literal notranslate"><span class="pre">plant</span></code> method:</p> |
1258 | 1257 | <div class="cell docutils container"> |
1259 | 1258 | <div class="cell_input docutils container"> |
@@ -1284,7 +1283,6 @@ <h3><span class="section-number">3.10.2.3. </span>Planting a Value<a class="head |
1284 | 1283 | </div> |
1285 | 1284 | <p>Cool! We replace <code class="docutils literal notranslate"><span class="pre">['apple',</span> <span class="pre">'orange',</span> <span class="pre">'grapes']</span></code> with <code class="docutils literal notranslate"><span class="pre">['apple',</span> <span class="pre">'orange']</span></code> while using the same chain!</p> |
1286 | 1285 | </section> |
1287 | | -</section> |
1288 | 1286 | </section> |
1289 | 1287 |
|
1290 | 1288 | <script type="text/x-thebe-config"> |
@@ -1371,12 +1369,10 @@ <h3><span class="section-number">3.10.2.3. </span>Planting a Value<a class="head |
1371 | 1369 | </li> |
1372 | 1370 | <li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#work-with-functions">3.10. Work with Functions</a><ul class="visible nav section-nav flex-column"> |
1373 | 1371 | <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#execute-a-function-n-times">3.10.1. Execute a Function n Times</a></li> |
1374 | | -<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#chaining">3.10.2. Chaining</a><ul class="nav section-nav flex-column"> |
1375 | | -<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#pydashs-methods">3.10.2.1. Pydash’s Methods</a></li> |
1376 | | -<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#customized-methods">3.10.2.2. Customized Methods</a></li> |
1377 | | -<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#planting-a-value">3.10.2.3. Planting a Value</a></li> |
1378 | | -</ul> |
1379 | | -</li> |
| 1372 | +<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#chaining">3.10.2. Chaining</a></li> |
| 1373 | +<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#pydashs-methods">3.10.3. Pydash’s Methods</a></li> |
| 1374 | +<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#customized-methods">3.10.4. Customized Methods</a></li> |
| 1375 | +<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#planting-a-value">3.10.5. Planting a Value</a></li> |
1380 | 1376 | </ul> |
1381 | 1377 | </li> |
1382 | 1378 | </ul> |
|
0 commit comments