Modern Python Solutions - Part 2
3.0 (5 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
103 students enrolled

Modern Python Solutions - Part 2

The latest in modern Python recipes for the busy programmer
3.0 (5 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
103 students enrolled
Created by Packt Publishing
Last updated 5/2017
English [Auto]
Current price: $86.99 Original price: $124.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 6 hours on-demand video
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Explore the basic and advanced class design in Python
  • Perform input/output operations and get to know the logical layouts
  • Get acquainted with advanced programming techniques in Python
  • Equip yourself with functional and statistical programming features
Course content
Expand all 46 lectures 05:55:17
+ Basics of Classes and Objects
9 lectures 01:09:49

This video gives an overview of this course.

Preview 03:39

The unifying concept behind a class definition is often captured as a summary of theresponsibilities allocated to the class. How can we do this effectively? What's a good way todesign a class? Let’s get the answers to these questions through this video.

Using a Class to Encapsulate Data and Processing

How can we design a class that makes use of Python's array of sophisticated built-in collections? Let’s see it.

Designing Classes with Lots of Processing

How can we create a class that allows us to use the object.attribute syntax instead ofobject['attribute']? This video will answer this question.

Designing Classes with Little Unique Processing

How can we create optimized classes with a fixed set of attributes? This video will show you how to do this.

Optimizing Small Objects with _slots_

Python has a wide variety of built-in collections.When we fold in the standard library, we have more choices, and more decisions to make.How can we choose the right data structure for our problem? Let’s explore this. 

Using More Sophisticated Collections

Now, since you know to distinguishbetween a complex algorithm and a collection and how to encapsulate thealgorithm and the data into separate classes, the alternative design strategy is to extend the collection to incorporate a useful algorithm.How can we extend Python's built-in collections? Let’s do it right now!

Extending a Collection

What if we have values that are used rarely, and are very expensive to compute? What canwe do to minimize the up-front computation, and only compute values when they are trulyneeded? Let's look into it.

Using Properties for Lazy Attributes

What can we do if we want to use attribute-like syntax for setting a value, but we also wantto perform eager calculations? And how can we eagerly compute values from attribute changes? Let’s get the answer to these questions through this video. 

Using Settable Properties to Update Eager Attributes
+ More Advanced Class Design
8 lectures 01:01:56

This video will let you distinguish between the semantic issues and apply the best possible technique while establishing connection between two classes.

Preview 12:51

This video will show you how to handle all the variations in card game rules. 

Separating Concerns via Multiple Inheritance

Python doesn't have a formal mechanism for abstract superclasses. It relies on duck typing to locate methods within a class. Let’s see how we canleverage this duck typing in Python.

Leveraging Python's Duck Typing

This video will let you work with implicit global objects and manage the operation through them. 

Managing Global and Singleton Objects

This video will teach you how to transform a flat list of details into a structure that for one column contains valuestaken from other columns.

Using more Complex Structures

When simulating card games, it's often essential to be able to sort the Card objects into adefined order. Most of our class definitions requires sorting objectsinto order.How do we create comparable objects?Let’s obtain the answer to this question.

Creating a Class that Has Orderable Object

How can we build a sorted collection of objects? How can we build a multiset or bag usinga sorted collection?Let’s answer these questions.

Defining an Ordered Collection

Removing items from a list has an interesting consequence.How can we delete multiple items from a list?Let’s see this.

Deleting from a List of Mappings
+ Functional and Reactive Programming Features
10 lectures 01:17:30

Is there some way to disentangle the collection structure from the processing function? Canwe yield results from processing as soon as each individual item is available? This video will provide you with an answer to these questions.

Preview 11:23

How can we stack or combine multiple generator functions to create a composite function? Let’s look into this.

Using Stacked Generator Expression

This video will show you, how you could simplify the generator functions and generator expressions which have the similar boilerplate code.

Applying Transformations to a Collection

This video will teach you the different ways to filter and pick items from a subset.

Picking a Subset

Can we generalize summation in a way that allows us to write a number of different kindsof reductions? How can we define the concept of reduction in a more general way? Let’s get the answers to these questions through this video.

Summarizing a Collection

This video will teach you the design considerations when workingwith multiple kinds of generator functions in conjunction with map, filter, and reduce. You will learn to cache intermediate results so that we can perform multiple reductions on the data.

Combining Map and Reduce Transformations

How can we write a process using generator functions that stops when the first valuematches some predicate? How do we avoid for all and quantify our logic with there exists? Let’s do it, with this video.

Implementing “There Exists” Processing

Let’s see how we can define a function that has some parameters provided in advance.

Creating a Partial Function

A great deal of the emphasis ofobject-oriented design is creating methods that mutate an object's state. Let’s see how we can use immutable data structures.

Simplifying Complex Algorithms with Immutable Data Structures

In many cases, there are advantages to using generators for processing these kinds ofstructures. How can we write generators that work with recursion? How does the yieldfrom statement save us from writing an extra loop? Let’s explore these questions.

Writing Recursive Generator Functions with the Yield from Statement
+ Input/Output, Physical Format, Logical Layout
11 lectures 01:19:59

How can we work with pathnames in a way that's independent of aspecific operatingsystem? How can we simplify common operations to make them as uniform as possible? This video is an answer to these questions.

Preview 13:02

Let’s see how we can be sure that resources are acquired and released properly and how we can avoid avoidresource leaks. 

Reading and Writing Files with Context Managers

Clearly, we can make backup copies of files. This introduces an extra processing step. Wecan do better. What's a good approach to createfiles that are fail-safe? Let’s see this!

Replacing a File While Preserving the Previous Version

How can we process data in one of the wide varieties of CSV formatting? Let’s learn to do it, right now!

Reading Delimited Files with the CSV Module

This video will show you how you can process this kind of data with the elegant simplicity of a CSV file and transform these irregular rows to a more regular data structure.

Reading Complex Formats Using Regular Expressions

How do we use the json module to parse JSON data in Python? Let’s look into this.

Reading JSON Documents

How do we use the xml.etree module to parse XML data in Python? Let’s explore this questions.

Reading XML Documents

A great deal of content on the Web is presented using HTML markup. A browser rendersthe data very nicely. How can we parse this data to extract the meaningful content from thedisplayed web page? Let’s learn this through this video.

Reading HTML Documents

This video will show you what you can do to replace complex syntax with something simpler.

Upgrading CSV from DictReader to the namedtuple Reader

This video will show you how you could upgrade the CSV and replace complex syntax with something simpler.

Upgrading CSV from a DictReader to a Namespace Reader

It's common to need to convert data from one format to another. For example, we mighthave a complex web log that we'd like to convert to a simpler format. This video will show you, how you could convert from one format to another.

Using Multiple Contexts for Reading and Writing Files
+ Statistical Programming and Linear Regression
8 lectures 01:06:03

A great deal of exploratory data analysis or EDA involves getting a summary of the data. How can we get basic descriptive statistics in Python? Let’s do it right now!

Preview 09:57

This video will let you perform statistical processing on (value, frequency) pairs.

Average of Values in a Counter

Another common statistical summary involves the degree of correlation between two sets of data. This is not directly supported by Python's standard library. How can we determine if two sets of data correlate? Let’s see this. 

Computing the Coefficient of a Correlation

How can we compute the linear regression parameters between two variables? Let’s answer this question.

Computing Regression Parameters

If we suspect we have cyclic data, can we leverage the previous correlation function to compute an autocorrelation? Let’s explore this question.

Computing an Autocorrelation

Let’s see how we can evaluate data to see if it's truly random if there's some meaningful variation. 

Confirming that the Data is Random – the Null Hypothesis

When we have statistical data, we often find data points which can be described as outliers. Let’s see how we locate and label potential outliers.

Locating Outliers

This video will show, how you can make one pass through a set of data and collect a number of descriptive Statistics.

Analyzing Many Variables in One Pass
  • Basic knowledge of Python programming is assumed.
  • This course is targeted at intermediate-level developers who want to expand their knowledge base in Python. Prior knowledge of the basics of Python programming is required (Most of the basics are covered in – Modern Python Solutions Part 1).
  • The software Requirements for this course are:
  • Python 3.5
  • Windows OS
  • Any good text editor

Python is the preferred choice of developers, engineers, data scientists, and hobbyists everywhere. It is a great scripting language that can power your applications and provide great speed, safety, and scalability. By exposing Python as a series of simple recipes, you can gain insight into specific language features in a particular context. Having a tangible context helps make the language or standard library features easier to understand. This video comes with over 100 recipes on the latest version of Python.

The videos will touch on all the necessary Python concepts related to data structures, OOP, functional programming, as well as statistical programming. You will get acquainted with the nuances of Python syntax and how to effectively use the advantages that it offers.

You will be armed with the knowledge of creating applications with flexible logging, powerful configuration, and command-line options, automated unit tests, and good documentation.You will end the book equipped with the knowledge of testing, web services, and configuration and application integration tips and tricks.

About the Authors

Steven F. Lott has been programming since the 70s, when computers were large, expensive, and rare. As a contract software developer and architect, he has worked on hundreds of projects, from very small to very large. He's been using Python to solve business problems for over 10 years.

He’s currently leveraging Python to implement microservices and ETL pipelines. His other titles with Packt Publishing include Python Essentials, Mastering Object-Oriented Python, Functional Python Programming, and Python for Secret Agents.

Steven is currently a technomad who lives in various places on the east coast of the U.S.

Who this course is for:
  • The videos will benefit everyone ranging from beginner to an expert.The course is for web developers, programmers, enterprise programmers, engineers, big data scientist, and so on. If you are experienced, it will expand your knowledge base.