PLAY PODCASTS
Practicing Python With CSV Files and Extracting Values With "filter()"
Episode 66

Practicing Python With CSV Files and Extracting Values With "filter()"

The Real Python Podcast · Real Python

June 25, 202155m 57s

Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

<p>Are you ready to practice your Python skills some more? There is a new set of practice problems prepared for you to tackle, and this time they&rsquo;re based on working with CSV files. This week on the show, David Amos is back, and he&rsquo;s brought another batch of PyCoder&rsquo;s Weekly articles and projects.</p> <p>David shares an article about functional programming with a focus on the &ldquo;filter&rdquo; function. The tutorial covers how to process an iterable and extract the items that satisfy a given condition. It also covers combining filter with other functional tools, and compares it to coding with Pythonic tools like list comprehensions and generator expressions.</p> <p>We cover several other articles and projects from the Python community including, Excel, Python, and the future of data science, a Bayesian analysis of Lego prices in Python, why can&rsquo;t comments appear after a line continuation character, teaching Python on the Raspberry Pi400 at the public library, a cross-platform editor designed for writing novels built with Python and Qt, and a text user interface with rich as the renderer.</p> <div class="alert alert-primary" role="alert"> <p><strong>Spotlight:</strong> <a href="https://realpython.com/courses/python-vs-javascript-for-python-devs/">Python vs JavaScript for Python Developers</a></p> <p>Python and JavaScript are two of the most popular programming languages in the world. In this course, you&rsquo;ll take a deep dive into the JavaScript ecosystem by comparing Python vs JavaScript. You&rsquo;ll learn the jargon, language history, and best practices from a Python developer&rsquo;s perspective.</p> </div> <p>Topics:</p> <ul> <li>00:00:00 &ndash; Introduction</li> <li>00:02:29 &ndash; Excel, Python, and the Future of Data Science</li> <li>00:07:50 &ndash; Python Practice Problems: Parsing CSV Files</li> <li>00:17:09 &ndash; Sponsor: Digital Ocean&rsquo;s App Platform</li> <li>00:17:45 &ndash; A Bayesian Analysis of Lego Prices in Python With PyMC3</li> <li>00:23:02 &ndash; Why Can&rsquo;t Comments Appear After a Line Continuation Character?</li> <li>00:28:40 &ndash; Python&rsquo;s filter(): Extract Values From Iterables</li> <li>00:34:57 &ndash; Video Course Spotlight</li> <li>00:36:24 &ndash; How I Teach Python on the Raspberry Pi 400 at the Public Library</li> <li>00:46:23 &ndash; novelWriter: Cross-Platform Editor Designed for Writing Novels Built With Python and Qt</li> <li>00:48:02 &ndash; textual: A Text User Interface With Rich as the Renderer</li> <li>00:54:58 &ndash; Thanks and goodbye</li> </ul> <p>Show Links:</p> <p><a href="https://www.infoworld.com/article/3620913/excel-python-and-data-science.html">Excel, Python, and the Future of Data Science</a> &ndash; What&rsquo;s the most widely used tool in data science? Is it pandas or NumPy? Is it the Python language itself? Not really. It&rsquo;s Excel. You might argue that data scientists aren&rsquo;t using Excel as their primary tool, and you might be right. But Excel enables non-technical users, like small business owners, to gain insights into their data. In this article, Anaconda CEO Peter Wang discusses his goal of making Python and PyData the &ldquo;conceptual successor&rdquo; to Excel.</p> <p><a href="https://realpython.com/python-interview-problem-parsing-csv-files/">Python Practice Problems: Parsing CSV Files</a> &ndash; In this tutorial, you&rsquo;ll prepare for future interviews by working through a set of Python practice problems that involve CSV files. You&rsquo;ll work through the problems yourself and then compare your results with solutions developed by the Real Python team.</p> <p><a href="https://austinrochford.com/posts/2021-06-10-lego-pymc3.html">A Bayesian Analysis of Lego Prices in Python With PyMC3</a> &ndash; Follow along with this in-depth analysis of LEGO prices to see Bayesian analysis in action. Along the way, you&rsquo;ll how pooled and unpooled linear models can be used to determine if a LEGO set is fairly priced. The article is quite technical, so experience with Bayesian statistics is recommended.</p> <p><a href="https://stackoverflow.com/questions/67912068/why-cant-comments-appear-after-a-line-continuation-character">Why Can&rsquo;t Comments Appear After a Line Continuation Character?</a> &ndash; Chaining together many object methods can create long tines that break the PEP 8 79-character line length recommendation. You can use <code>\</code> to break the chain of methods onto individual lines, but if you want to leave comments at the end of some of the lines, you&rsquo;re out of luck. There&rsquo;s another pattern, though, that solves this.</p> <p><a href="https://realpython.com/python-filter-function/">Python&rsquo;s filter(): Extract Values From Iterables</a> &ndash; In this step-by-step tutorial, you&rsquo;ll learn how Python&rsquo;s <code>filter()</code> works and how to use it effectively in your programs. You&rsquo;ll also learn how to use list comprehension and generator expressions to replace <code>filter()</code> and make your code more Pythonic.</p> <p><a href="https://opensource.com/article/21/6/teach-python-raspberry-pi">How I Teach Python on the Raspberry Pi 400 at the Public Library</a> &ndash; Community-based programming courses are a great way to introduce folks to computer programming that otherwise may not have the means to do so. One of the barriers to learning to code is cost. You need a computer to program on, after all. But with the advent of tiny computers like the Raspberry Pi, computers aimed at education are more affordable than ever.</p> <p>Projects:</p> <ul> <li><a href="https://github.com/vkbo/novelWriter">novelWriter: Cross-Platform Editor Designed for Writing Novels Built With Python and Qt</a></li> <li><a href="https://github.com/willmcgugan/textual">textual: A Text User Interface With Rich as the Renderer</a></li> </ul> <p>Additional Links:</p> <ul> <li><a href="https://realpython.com/podcasts/rpp/27/">Episode 27: Preparing for an Interview With Python Practice Problems</a></li> <li><a href="https://docs.pymc.io/">PyMC3: Probabilistic Programming in Python</a></li> <li><a href="https://black.readthedocs.io/en/stable/">Black: The uncompromising code formatter</a></li> <li><a href="https://opensource.com/article/21/3/raspberry-pi-400-review">My review of the Raspberry Pi 400</a></li> <li><a href="https://www.willmcgugan.com/blog/tech/post/textual-progress/">Will McGugan&rsquo;s Blog: Introducing Textual</a></li> </ul> <p>Level up your Python skills with our expert-led courses:</p> <ul> <li><a href="https://realpython.com/courses/python-vs-javascript-for-python-devs/">Python vs JavaScript for Python Developers</a></li> <li><a href="https://realpython.com/courses/map-function-transform-iterables/">Python&#x27;s map() Function: Transforming Iterables</a></li> <li><a href="https://realpython.com/courses/functional-programming-python/">From Python&#x27;s Functional Primitives to Parallelism</a></li> </ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast &amp; join our community of Pythonistas</a></p>