Movatterモバイル変換


[0]ホーム

URL:


Packt
Search iconClose icon
Search icon CANCEL
Subscription
0
Cart icon
Your Cart(0 item)
Close icon
You have no products in your basket yet
Save more on your purchases!discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Profile icon
Account
Close icon

Change country

Modal Close icon
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timerSALE ENDS IN
0Days
:
00Hours
:
00Minutes
:
00Seconds
Home> Programming> Functional Programming> Functional Python Programming, 3rd edition
Functional Python Programming, 3rd edition
Functional Python Programming, 3rd edition

Functional Python Programming, 3rd edition: Use a functional approach to write succinct, expressive, and efficient Python code , Third Edition

Arrow left icon
Profile Icon Steven F. Lott
Arrow right icon
€8.98€28.99
Full star iconFull star iconFull star iconFull star iconHalf star icon4.5(28 Ratings)
eBookDec 2022576 pages3rd Edition
eBook
€8.98 €28.99
Paperback
€35.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.98 €28.99
Paperback
€35.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature iconInstant access to your Digital eBook purchase
Product feature icon Download this book inEPUB andPDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature iconDRM FREE - Read whenever, wherever and however you want
Product feature iconAI Assistant (beta) to help accelerate your learning

Contact Details

Modal Close icon
Payment Processing...
tickCompleted

Billing Address

Table of content iconView table of contentsPreview book icon Preview Book

Functional Python Programming, 3rd edition

 1
Understanding Functional Programming

Functional programming defines a computation using expressions and evaluation; often, they are encapsulated in function definitions. It de-emphasizes or avoids the complexity of state change and mutable objects. This tends to create programs that are more succinct and expressive. In this chapter, we’ll introduce some of the techniques that characterize functional programming. We’ll identify some of the ways to map these features toPython. Finally, we’ll also address some ways in which the benefits of functional programming accrue when we use these design patterns to build Python applications.

This book doesn’t contain a tutorial introduction to the Python language. We assume the reader knows some Python. In many cases, if the reader knows a functional programming language, then that knowledge can be applied to Python via the examples in this book. For background information on Python, seePython in a Nutshell, 4th Edition, or any of the Python introductions from Packt Publishing.

Python has a broad variety of programming features, including numerous ways to support functional programming. As we will see throughout this book, Python is not apurelyfunctional programming language; instead, it relies on a mixture of features. We’ll see that the language offers enough of the right kinds of features to provide the benefits of functional programming. It also retains all the optimization power of an imperative programming language. Further, we can mix the object-oriented and functional features to make use of the best aspects of both paradigms.

We’ll also look at a problem domain that we’ll use for many of the examples in this book. We’ll try to stick closely toExploratory Data Analysis (EDA). For more information, seehttps://www.itl.nist.gov/div898/handbook/eda/eda.htm. The idea of ”exploratory” means doing data collection followed by analysis, with a goal of inferring what model would be appropriate to describe the data. This is a helpful domain because many of the algorithms are good examples of functional programming. Furthermore, the benefits of functional programming accrue rapidly when exploring data to locate trends and relationships.

Our goal is to establish some essential principles of functional programming. The more serious Python code will begin inChapter 2,Introducing EssentialFunctional Concepts.

In this chapter, we’ll focus on the following topics:

  • Comparing and contrasting the functional paradigm with other ways of designing software. We’ll look at how Python’s approach can be called a ”hybrid” between functional programming and object-oriented programming.

  • We’ll look in depth at a specific example extracted from the functional programming literature.

  • We’ll conclude with an overview of EDA and why this discipline seems to provide numerous examples of functional programming.

We’ll focus on Python 3.10 features in this book. This includes the newmatch statement.

Throughout this book, we’ll include Python 3 type hints in the examples. Type hints can help a reader visualize the essential purpose behind a function definition. Type hints are analyzed with themypy tool. As with unit testing,mypycan be part of a tool chain to produce high-quality software.

1.1The functional style of programming

We’ll define functional programming through a series of examples. The distinguishing feature between these examples is the concept ofstate, specifically the state of the computation.

Python’s strong imperative traits mean that the state of a computation is defined by the values of the variables in the various namespaces. Some kinds of statements make a well-defined change to the state by adding, changing, or removing a variable. We call thisimperativebecause specific kinds of statements change the state.

In Python, the assignment statement is the primary way to change the state. Python has other statements, such asglobal ornonlocal, which modify the rules for variables in a particular namespace. Statements such asdef,class, andimport change the processing context. The bulk of the remaining statements provide ways to choose which assignment statements get executed. The focus of all these various statement types, however, is on changing the state of the variables.

In a functional language, we replace the state—the changing values of variables—with a simpler notion of evaluating functions. Each function evaluation creates a new object or objects from existing objects. Since a functional program is a composition of functions, we can design lower-level functions that are easy to understand, and then create compositions of functions that can also be easier to visualize than a complex sequence of statements.

Function evaluation more closely parallels mathematical formalisms. Because of this, we can often use simple algebra to design an algorithm that clearly handles the edge cases and boundary conditions. This makes us more confident that the functions work. It also makes it easy to locate test cases for formal unit testing.

It’s important to note that functional programs tend to be relatively succinct, expressive, and efficient compared to imperative (object-oriented or procedural) programs. The benefit isn’t automatic; it requires careful design. This design effort for functional programming is often smaller than for procedural programming. Some developers experienced in imperative and object-oriented styles may find it a challenge to shift their focus from stateful designs to functional designs.

1.2Comparing and contrasting procedural and functional styles

We’ll use a tiny example program to illustrate a non-functional, or procedural, style of programming. This example computes a sum of a sequence of numbers. Each of the numbers has a specific property that makes it part of the sequence.

def sum_numeric(limit: int = 10) -> int:     s = 0     for n in range(1, limit):         if n % 3 == 0 or n % 5 == 0:             s += n     return s

The sum computed by this function includes only numbers that are multiples of 3 or 5. We’ve made this program strictly procedural, avoiding any explicit use of Python’s object features. The function’s state is defined by the values of the variabless andn. The variablen takes on values such that 1n <10. As the iteration involves an ordered exploration of values for then variable, we can prove that it will terminate when the value ofn is equal to the value oflimit.

There are two explicit assignment statements, both setting values for thes variable. These state changes are visible. The value ofn is set implicitly by thefor statement. The state change in thes variable is an essential element of the state of the computation.

Now let’s look at this again from a purely functional perspective. Then, we’ll examine a more Pythonic perspective that retains the essence of a functional approach while leveraging a number of Python’s features.

1.2.1Using the functional paradigm

In a functional sense, the sum of the multiples of 3 and 5 can be decomposed into two parts:

  • The sum of a sequence of numbers

  • A sequence of values that pass a simple test condition, for example, being multiples of 3 and 5

To be super formal, we can define the sum as a function using simpler language components. The sum of a sequence has a recursive definition:

from collections.abc import Sequence def sumr(seq : Sequence[int]) -> int:     if len(seq) == 0:         return 0     return seq[0] + sumr(seq[1:])

We’ve defined the sum in two cases. Thebase casestates that the sum of a zero-length sequence is 0. Therecursive casestates that the sum of a sequence is the first value plus the sum of the rest of the sequence. Since the recursive definition depends on a shorter sequence, we can be sure that it will (eventually) devolve to the base case.

Here are some examples of how this function works:

>>> sumr([7, 11]) 18 >>> sumr([11]) 11 >>> sumr([]) 0

The first example computes the sum of a list with multiple items. The second example shows how the recursion rule works by adding the first item,seq[0], to the sum of the remaining items,sumr(seq[1:]). Eventually, the computation of the result involves the sum of an empty list, which is defined as 0.

The+ operator on the last line of thesumr function and the initial value of 0 in the base case characterize the equation as a sum. Consider what would happen if we changed the operator to* and the initial value to 1: this new expression would compute a product. We’ll return to this simple idea ofgeneralizationin the following chapters.

Similarly, generating a sequence of values with a given property can have a recursive definition, as follows:

from collections.abc import Sequence, Callable def until(         limit: int,         filter_func: Callable[[int], bool],         v: int ) -> list[int]:     if v == limit:         return []     elif filter_func(v):         return [v] + until(limit, filter_func, v + 1)     else:         return until(limit, filter_func, v + 1)

In this function, we’ve compared a given value,v, against the upper bound,limit. Ifv has reached the upper bound, the resulting list must be empty. This is the base case for the given recursion.

There are two more cases defined by an externally definedfilter_func() function. The value ofv is passed by thefilter_func() function; if this returns a very small list, containing one element, this can be concatenated with any remaining values computed by theuntil() function.

If the value ofv is rejected by thefilter_func() function, this value is ignored and the result is simply defined by any remaining values computed by theuntil() function.

We can see that the value ofv will increase from an initial value until it reacheslimit, assuring us that we’ll reach the base case.

Before we can see how to use theuntil() function, we’ll define a small function to filter values that are multiples of 3 or 5:

def mult_3_5(x: int) -> bool:     return x % 3 == 0 or x % 5 == 0

We could also have defined this as a lambda object to emphasize succinct definitions of simple functions. Anything more complex than a one-line expression requires thedef statement.

This function can be combined with theuntil() function to generate a sequence of values, which are multiples of 3 and 5. Here’s an example:

>>> until(10, mult_3_5, 0) [0, 3, 5, 6, 9]

Looking back at the decomposition at the top of this section, we now have a way to compute sums and a way to compute the sequence of values.

We can combine thesumr() anduntil() functions to compute a sum of values. Here’s the resulting code:

def sum_functional(limit: int = 10) -> int:     return sumr(until(limit, mult_3_5, 0))

This small application to compute a sum doesn’t make use of the assignment statement to set the values of variables. It is a purely functional, recursive definition that matches the mathematical abstractions, making it easier to reason about. We can be confident each piece works separately, giving confidence in the whole.

As a practical matter, we’ll use a number of Python features to simplify creating functional programs. We’ll take a look at a number of these optimizations in the next version of this example.

1.2.2Using a functional hybrid

We’ll continue this example with a mostly functional version of the previous example to compute the sum of multiples of 3 and 5. Ourhybridfunctional version might look like the following:

def sum_hybrid(limit: int = 10) -> int:     return sum(         n for n in range(1, limit)         if n % 3 == 0 or n % 5 == 0     )

We’ve used a generator expression to iterate through a collection of values and compute the sum of these values. Therange(1, 10) object is an iterable; it generates a sequence of values{n1n <10}, often summarized as “values ofn such that 1 is less than or equal tonandnis less than 10.” The more complex expressionn for n in range(1, 10) if n % 3 == 0 or n% 5 == 0 is also a generator. It produces a set of values,{n1n <10(n0 mod 3n0 mod 5)}; something we can describe as “values ofnsuch that 1 is less than or equal tonandnis less than 10 andnis equivalent to 0 modulo 3 ornis equivalent to 0 modulo 5.” These are multiples of 3 and 5 taken from the set of values between 1 and 10. The variablen is bound, in turn, to each of the values provided by therange object. Thesum() function consumes the iterable values, creating a final object, 23.

The bound variable,n, doesn’t exist outside the generator expression. The variablen isn’t visible elsewhere in the program.

The variablen in this example isn’t directly comparable to the variablen in the first two imperative examples. Afor statement (outside a generator expression) creates a proper variable in the local namespace. The generator expression does not create a variable in the same way that afor statement does:

>>> sum( ...     n for n in range(1, 10) ...     if n % 3 == 0 or n % 5 == 0 ... ) 23 >>> n Traceback (most recent call last):    File "<stdin>", line 1, in <module> NameError: name ’n’ is not defined

The generator expression doesn’t pollute the namespace with variables, liken, which aren’t relevant outside the very narrow context of the expression. This is a pleasant feature that ensures we won’t be confused by the values of variables that don’t have a meaning outside a single expression.

1.2.3The stack of turtles

When we use Python for functional programming, we embark down a path that will involve a hybrid that’s not strictly functional. Python is notHaskell,OCaml, orErlang. For that matter, our underlying processor hardware is not functional; it’s not even strictly object-oriented, as CPUs are generally procedural.

All programming languages rest on abstractions, libraries, frameworks and virtual machines. These abstractions, in turn, may rely on other abstractions, libraries, frameworks and virtual machines. The most apt metaphor is this: the world is carried on the back of a giant turtle. The turtle stands on the back of another giant turtle. And that turtle, in turn, is standing on the back of yet another turtle.

It’s turtles all the way down.

— Anonymous

There’s no practical end to the layers of abstractions. Even something as concrete as circuits and electronics may be an abstraction to help designers summarize the details of quantum electrodynamics.

More importantly, the presence of abstractions and virtual machines doesn’t materially change our approach to designing software to exploit the functional programming features of Python.

Even within the functional programming community, there are both purer and less pure functional programming languages. Some languages make extensive use of monads to handle stateful things such as file system input and output. Other languages rely on a hybridized environment that’s similar to the way we use Python. In Python, software can be generally functional, with carefully chosen procedural exceptions.

Our functional Python programs will rely on the following three stacks of abstractions:

  • Our applications will be functions—all the way down—until we hit the objects;

  • The underlying Python runtime environment that supports our functional programming is objects—all the way down—until we hit the libraries;

  • The libraries that support Python are a turtle on which Python stands.

The operating system and hardware form their own stack of turtles. These details aren’t relevant to the problems we’re going to solve.

1.3A classic example of functional programming

As part of our introduction, we’ll look at a classic example of functional programming. This is based on the paperWhy Functional Programming Matters by John Hughes. The article appeared in a paper calledResearch Topics inFunctional Programming, edited by D. Turner, published by Addison-Wesley in 1990.

Here’s a link to one of the papers inResearch Topics in FunctionalProgramming, “Why Functional Programming Matters”:http://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf

This paper is a profound discussion of functional programming. There are several examples given. We’ll look at just one: theNewton-Raphson algorithmfor locating any roots of a function. In this case, we’ll define a function that will compute a square root of a number.

It’s important because many versions of this algorithm rely on the explicit state managed via loops. Indeed, the Hughes paper provides a snippet of theFortran code that emphasizes stateful, imperative processing.

The backbone of this approximation is the calculation of the next approximation from the current approximation. Thenext_() function takesx, an approximation to thesqrt(n) value, and calculates a next value that brackets the proper root. Take a look at the following example:

def next_(n: float, x: float) -> float:     return (x + n / x) / 2

This function computes a series of values that will quickly converge on some valuexsuch thatx=n x, which meansx=√-- n.

Note that the namenext() would collide with a built-in function. Calling itnext_() lets us follow the original presentation as closely as possible, using Pythonic names.

Here’s how the function looks when used in Python’s interactive REPL:

>>> n = 2 >>> f = lambda x: next_(n, x) >>> a0 = 1.0 >>> [round(x, 4) ... for x in (a0, f(a0), f(f(a0)), f(f(f(a0))),) ... ] [1.0, 1.5, 1.4167, 1.4142]

We defined thef() function as a lambda that will converge on√ -- n wheren= 2. We started with 1.0 as the initial value fora0. Then we evaluated a sequence of recursive evaluations:a1 =f(a0),a2 =f(f(a0)), and so on. We evaluated these functions using a generator expression so that we could round each value to four decimal places. This makes the output easier to read and easier to use withdoctest. The sequence appears to converge rapidly on√-- 2. To get a more precise answer, we must continue to perform the series of steps after the first four shown above.

We can write a function that will (in principle) generate an infinite sequence ofai values. This series will converge on the proper square root:

from collections.abc import Iterator, Callable def repeat(         f: Callable[[float], float],         a: float ) -> Iterator[float]:     yield a     yield from repeat(f, f(a))

This function will generate a sequence of approximations using a function,f(), and an initial value,a. If we provide thenext_() function defined earlier, we’ll get a sequence of approximations to the square root of then argument.

Therepeat() function expects thef() function to have a single argument; however, ournext_() function has two arguments. We’ve used a lambda object,lambda x: next_(n, x), to create a partial version of thenext_() function with one of two variables bound.

The Python generator functions can’t be trivially recursive; they must explicitly iterate over the recursive results, yielding them individually.

Attempting to use a simplereturn repeat(f, f(a)) will end the iteration, returning a generator expression instead of yielding values.

There are two ways to return all the values instead of returning a generator expression, which are as follows:

  • We can write an explicitfor statement to yield values as follows:

    for x in some_iter: yield x
  • We can use theyield from expression as follows:

    yield from some_iter

Both techniques of yielding the values of a recursive generator function are will have similar results. We’ll try to emphasizeyield from.

It turns out thatyield andyield from are a bit more sophisticated than we’ve shown here. For our purposes, we’ll limit ourselves to working with recursive results. For more information on the full feature set foryield andyield from, see PEP 342 and PEP 380:https://peps.python.org/pep-0342/ andhttps://peps.python.org/pep-0380/.

Of course, we don’t want the entire infinite sequence created by therepeat() function. It’s essential to stop generating values when we’ve found the square root we’re looking for. The common symbol for the limit we can consider “close enough” is the Greek letterepsilon,𝜖.

In Python, we have to be a little clever when taking items from an infinite sequence one at a time. It works out well to use a simple interface function that wraps a slightly more complex recursion. Take a look at the following code snippet:

from collections.abc import Iterator def within(         𝜖: float,         iterable: Iterator[float] ) -> float:     def head_tail(             𝜖: float,             a: float,             iterable: Iterator[float]     ) -> float:         b = next(iterable)         if abs(a-b) <= 𝜖:             return b         return head_tail(𝜖, b, iterable)      return head_tail(𝜖, next(iterable), iterable)

We’ve defined an internal function,head_tail(), which accepts the tolerance,𝜖, an item from the iterable sequence,a, and the rest of the iterable sequence,iterable. The first item from the iterable, extracted with thenext() function, is bound to a name,b. If|ab|≤𝜖, the two values ofa andb are close enough to call the value ofb the square root; the difference is less than or equal to the very small value of𝜖. Otherwise, we use theb value in a recursive invocation of thehead_tail() function to examine the next pair of values.

Ourwithin() function properly initializes the internalhead_tail() function with the first value from theiterable parameter.

We can use the three functions,next_(),repeat(), andwithin(), to create a square root function, as follows:

def sqrt(n: float) -> float:     return within(         𝜖=0.0001,         iterable=repeat(             lambda x: next_(n, x),             1.0         )     )

We’ve used therepeat() function to generate a (potentially) infinite sequence of values based on thenext_(n,x) function. Ourwithin() function will stop generating values in the sequence when it locates two values with a difference less than𝜖.

This definition of thesqrt() function provides useful default values to the underlyingwithin() function. It provides an𝜖value of 0.0001 and an initiala0 value of 1.0.

A more advanced version could use default parameter values to make changes possible. As an exercise, the definition ofsqrt() can be rewritten so an expression such assqrt(1.0, 0.000_01, 3) will start with an approximation of 1.0 and compute the value of√ -- 3 to within 0.00001. For most applications, the initiala0 value can be 1.0. However, the closer it is to the actual square root, the more rapidly this algorithm converges.

The original example of this approximation algorithm was shown in the Miranda language. It’s easy to see there are some profound differences between Miranda and Python. In spite of the differences, the similarities give us confidence that many kinds of functional programming can be easily implemented in Python.

Thewithin function shown here is written to match the original article’s function definition. Python’sitertools library provides atakewhile() function that might be better for this application than thewithin() function. Similarly, themath.isclose() function may be better than theabs(a-b) <= 𝜖 expression used here. Python offers a great many pre-built functional programming features; we’ll look closely at these functions inChapter 8,The ItertoolsModule andChapter 9,Itertools for Combinatorics – Permutations andCombinations.

1.4Exploratory data analysis

Later in this book, we’ll use the field of exploratory data analysis as a source for concrete examples of functional programming. This field is rich with algorithms and approaches to working with complex datasets; functional programming is often a very good fit between the problem domain and automated solutions.

While details vary from author to author, there are several widely accepted stages of EDA. These include the following:

  • Data preparation: This might involve extraction and transformation for source applications. It might involve parsing a source data format and doing some kind of data scrubbing to remove unusable or invalid data. This is an excellent application of functional design techniques.

David Mertz’s superb bookCleaningData for Effective Data Science(https://www.packtpub.com/product/cleaning-data-for-effective-data-science/9781801071291) provides additional information on data cleaning. This is a crucial subject for all data science and analytical work.

  • Data exploration: This is a description of the available data. This usually involves the essential statistical functions. This is another excellent place to explore functional programming. We can describe our focus as univariate and bivariate statistics, but that sounds too daunting and complex. What this really means is that we’ll focus on mean, median, mode, and other related descriptive statistics. Data exploration may also involve data visualization. We’ll skirt this issue because it doesn’t involve very much functional programming.

For more information on Python visualization, seeInteractive Data Visualization with Python,https://www.packtpub.com/product/interactive-data-visualization-with-python-second-edition/9781800200944. Seehttps://www.projectpro.io/article/python-data-visualization-libraries/543 for some additional visualization libraries.

  • Data modeling and machine learning: This tends to be prescriptive as it involves extending a model to new data. We’re going to skirt around this because some of the models can become mathematically complex. If we spend too much time on these topics, we won’t be able to focus on functional programming.

  • Evaluation and comparison: When there are alternative models, each must be evaluated to determine which is a better fit for the available data. This can involve ordinary descriptive statistics of model outputs, which can benefit from functional design techniques.

One goal of EDA is often to create a model that can be deployed as a decision support application. In many cases, a model might be a simple function. A functional programming approach can apply the model to new data and display results for human consumption.

1.5Summary

In this chapter, we’ve looked at programming paradigms with an eye toward distinguishing the functional paradigm from the imperative paradigm. For our purposes, object-oriented programming is a kind of imperative programming; it relies on explicit state changes. Our objective in this book is to explore the functional programming features of Python. We’ve noted that some parts of Python don’t allow purely functional programming; we’ll be using some hybrid techniques that meld the good features of succinct, expressive functional programming with some high-performance optimizations in Python.

In the next chapter, we’ll look at five specific functional programming techniques in detail. These techniques will form the essential foundation for our hybridized functional programming in Python.

1.6Exercises

The exercises in this book are based on code available from Packt Publishing on GitHub. Seehttps://github.com/PacktPublishing/Functional-Python-Programming-3rd-Edition.

In some cases, the reader will notice that the code provided on GitHub includes partial solutions to some of the exercises. These serve as hints, allowing the reader to explore alternative solutions.

In many cases, exercises will need unit test cases to confirm they actually solve the problem. These are often identical to the unit test cases already provided in the GitHub repository. The reader will need to replace the book’s example function name with their own solution to confirm that it works.

1.6.1Convert an imperative algorithm to functional code

The following algorithm is stated as imperative assignment statements and a while construct to indicate processing something iteratively.

Algorithm 1: Imperative iteration

What does this appear to compute? Given Python built-in functions likesum, can this be simplified?

It helps to write this in Python and refactor the code to be sure that correct answers are created.

A test case is the following:

V ← {7.46,6.77,12.74,7.11,7.81,8.84,6.08,5.39,8.15,6.42,5.73}

The computed value formis approximately7.5.

1.6.2Convert step-wise computation to functional code

The following algorithm is stated as a long series of single assignment statements. The rad(x) function converts degrees to radians, rad(d) =π×1d80. See themath module for an implementation.

Algorithm 2: Imperative computation

Is this code easy to understand? Can you summarize this computation as a short mathematical-looking formula?

Breaking it down into sections, lines 1 to 8 seem to be focused on some conversions, differences, and mid-point computations. Lines 9 to 12 compute two values,xandy. Can these be summarized or simplified? The final four lines do a relatively direct computation ofd. Can this be summarized or simplified? As a hint, look atmath.hypot() for a function that might be applicable in this case.

It helps to write this in Python and refactor the code.

A test case is the following:

  lat132.82950
  lon1←−79.93021
  lat232.74412
  lon2←−79.85226

The computed value fordis approximately6.4577.

Refactoring the code can help to confirm your understanding.

1.6.3Revise the sqrt() function

Thesqrt() function defined in theA classic example of functional programming section has only a single parameter value,n. Rewrite this to create a more advanced version using default parameter values to make changes possible. An expression such assqrt(1.0, 0.000_01, 3) will start with an approximation of 1.0 and compute the value to a precision of 0.00001. The final parameter value,3, is the value ofn, the number we need to compute the square root of.

1.6.4Data cleansing steps

A file of source data has US ZIP codes in a variety of formats. This problem often arises when spreadsheet software is used to collect or transform data.

  • Some ZIP codes were processed as numbers. This doesn’t work out well for places in New England, where ZIP codes have a leading zero. For example, one of Portsmouth, New Hampshire’s codes should be stated as03801. In the source file, it is3801. For the most part, these numbers will have five or nine digits, but some codes in New England will be four or eight digits when a single leading zero was dropped. For Puerto Rico, there may be two leading zeroes.

  • Some ZIP codes are stored as strings, 123450100, where a four-digit extension for a post-office box has been appended to the base five-digit code.

A CSV-format file has only text values. However, when data in the file has been processed by a spreadsheet, problems can arise. Because a ZIP code has only digits, it can be treated as numeric data. This means the original data values will have been converted to a number, and then back to a text representation. These conversions will drop the leading zeroes. There are a number of workarounds in various spreadsheet applications to prevent this problem. If they’re not used, the data can have anomalous values that can be cleansed to restore the original representation.

The objective of the exercise is to compute a histogram of the most popular ZIP codes in the source data file. The data must be cleansed to have the following two ZIP formats:

  • Five characters with no post-office box, for example03801

  • Ten characters with a hyphen, for example03899-9876

The essential histogram can be done with acollections.Counter object as follows.

from collections import Counter import csv from pathlib import Path  DEFAULT_PATH = Path.cwd() / "address.csv"  def main(source_path: Path = DEFAULT_PATH) -> None:     frequency: Counter[str] = Counter()     with source_path.open() as source:         rdr = csv.DictReader(source)         for row in rdr:             if "-" in row[’ZIP’]:                 text_zip = row[’ZIP’]                 missing_zeroes = 10 - len(text_zip)                 if missing_zeroes:                     text_zip = missing_zeroes*’0’ + text_zip             else:                 text_zip = row[’ZIP’]                 if 5 < len(row[’ZIP’]) < 9:                     missing_zeroes = 9 - len(text_zip)                 else:                     missing_zeroes = 5 - len(text_zip)                 if missing_zeroes:                     text_zip = missing_zeroes*’0’ + text_zip             frequency[text_zip] += 1     print(frequency)  if __name__ == "__main__":     main()

This makes use of imperative processing features to read a file. The overall design, using afor statement to process rows of a file, is an essential Pythonic feature that we can preserve.

On the other hand, the processing of thetext_zip andmissing_zeroes variables through a number of state changes seems like it’s a potential source for confusion.

This can be refactored through several rewrites:

  1. Decompose themain() function into two parts. A newzip_histogram() function should be written to contain much of the processing detail. This function will process the opened file, and return aCounter object. A suggested signature is the following:

        def zip_histogram(             reader: csv.DictReader[str]) -> Counter[str]:         pass

    Themain() function is left with the responsibility to open the file, create thecsv.DictReader instance, evaluatezip_histogram(), and print the histogram.

  2. Once thezip_histogram() function has been defined, the cleansing of theZIP attribute can be refactored into a separate function, with a name likezip_cleanse(). Rather than setting the value of thetext_zip variable, this function can return the cleansed result. This can be tested separately to be sure the various cases are handled gracefully.

  3. The distinction between long ZIP codes with a hyphen and without a hyphen is something that should be fixed. Once thezip_cleanse() works in general, add a new function to inject hyphens into ZIP codes with only digits. This should transform38011234 to03801-1234. Note that short, five-digit ZIP codes do not need to have a hyphen added; this additional transformation only applies to nine-digit codes to make them into ten-position strings.

The finalzip_histogram() function should look something like the following:

def zip_histogram(         reader: csv.DictReader[str]) -> Counter[str]:     return Counter(         zip_cleanse(             row[’ZIP’]         ) for row in reader     )

This provides a framework for performing a focused data cleanup in the given column. It allows us to distinguish between CSV and file processing features, and the details of how to clean up a specific column of data.

1.6.5(Advanced) Optimize this functional code

The following algorithm is stated as a single ”step” that has been decomposed into three separate formulae. The decomposition is more a concession to the need to fit the expression into the limits of a printed page than a useful optimization. The rad(x) function converts degrees to radians, rad(d) =π×-d- 180.

Algorithm 3: Redundant expressions

There are a number of redundant expressions, like rad(lat1) and rad(lat2). If these are assigned to local variables, can the expression be simplified?

The final computation ofddoes not match the conventional understanding of computing a hypotenuse,∘ ------- x2 + y2. Should the code be refactored to match the definition inmath.hypot?

It helps to start by writing this in Python and then refactoring the code.

A test case is the following:

  lat132.82950
  lon1←−79.93021
  lat232.74412
  lon2←−79.85226

The computed value fordis approximately6.4577.

Refactoring the code can help to confirm your understanding of what this code really does.

Join our community Discord space

Join our Python Discord workspace to discuss and know more about the book:https://packt.link/dHrHU

PIC

Left arrow icon

Page1 of 8

Right arrow icon
Download code iconDownload Code

Key benefits

  • Learn how, when, and why to adopt functional elements in your projects
  • Explore the Python modules essential to functional programming, like itertools and functools
  • Cover examples relevant to mathematical, statistical, and data analysis domains

Description

Not enough developers understand the benefits of functional programming, or even what it is. Author Steven Lott demystifies the approach, teaching you how to improve the way you code in Python and make gains in memory use and performance. If you’re a leetcoder preparing for coding interviews, this book is for you.Starting from the fundamentals, this book shows you how to apply functional thinking and techniques in a range of scenarios, with Python 3.10+ examples focused on mathematical and statistical algorithms, data cleaning, and exploratory data analysis. You'll learn how to use generator expressions, list comprehensions, and decorators to your advantage. You don't have to abandon object-oriented design completely, though – you'll also see how Python's native object orientation is used in conjunction with functional programming techniques.By the end of this book, you'll be well-versed in the essential functional programming features of Python and understand why and when functional thinking helps. You'll also have all the tools you need to pursue any additional functional topics that are not part of the Python language.

Who is this book for?

The functional paradigm is very useful for programmers working in data science or preparing for technical interviews, but any Python developer who wants to create more reliable, succinct, and expressive code will have much to learn from this book.No prior knowledge of functional programming is required to get started, though Python programming knowledge is assumed. A running Python environment is essential.

What you will learn

  • Use Python's libraries to avoid the complexities of state-changing classes
  • Leverage built-in higher-order functions to avoid rewriting common algorithms
  • Write generator functions to create lazy processing
  • Design and implement decorators for functional composition
  • Make use of Python type annotations to describe parameters and results of functions
  • Apply functional programming to concurrency and web services
  • Explore the PyMonad library for stateful simulations

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date :Dec 30, 2022
Length:576 pages
Edition :3rd
Language :English
ISBN-13 :9781803236568
Category :

What do you get with eBook?

Product feature iconInstant access to your Digital eBook purchase
Product feature icon Download this book inEPUB andPDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature iconDRM FREE - Read whenever, wherever and however you want
Product feature iconAI Assistant (beta) to help accelerate your learning

Contact Details

Modal Close icon
Payment Processing...
tickCompleted

Billing Address

Product Details

Publication date :Dec 30, 2022
Length:576 pages
Edition :3rd
Language :English
ISBN-13 :9781803236568
Category :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99billed monthly
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconSimple pricing, no contract
€189.99billed annually
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconChoose a DRM-free eBook or Video every month to keep
Feature tick iconPLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick iconExclusive print discounts
€264.99billed in 18 months
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconChoose a DRM-free eBook or Video every month to keep
Feature tick iconPLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick iconExclusive print discounts

Frequently bought together


Advanced Python Programming
Advanced Python Programming
Read more
Mar 2022606 pages
Full star icon4.6 (14)
eBook
eBook
€8.98€28.99
€35.99
Mastering Python
Mastering Python
Read more
Apr 2016486 pages
Full star icon4.6 (65)
eBook
eBook
€8.98€26.99
€32.99
€37.99
Functional Python Programming, 3rd edition
Functional Python Programming, 3rd edition
Read more
Dec 2022576 pages
Full star icon4.5 (28)
eBook
eBook
€8.98€28.99
€35.99
Stars icon
Total109.97
Advanced Python Programming
€35.99
Mastering Python
€37.99
Functional Python Programming, 3rd edition
€35.99
Total109.97Stars icon
Buy 2+ to unlock€6.99 prices - master what's next.
SHOP NOW

Table of Contents

17 Chapters
Chapter 1: Understanding Functional ProgrammingChevron down iconChevron up icon
Chapter 1: Understanding Functional Programming
1.1 The functional style of programming
1.2 Comparing and contrasting procedural and functional styles
1.3 A classic example of functional programming
1.4 Exploratory data analysis
1.5 Summary
1.6 Exercises
Join our community Discord space
Chapter 2: Introducing Essential Functional ConceptsChevron down iconChevron up icon
Chapter 2: Introducing Essential Functional Concepts
2.1 Functions as first-class objects
2.2 Immutable data
2.3 Strict and non-strict evaluation
2.4 Lazy and eager evaluation
2.5 Recursion instead of an explicit loop state
2.6 Functional type systems
2.7 Familiar territory
2.8 Learning some advanced concepts
2.9 Summary
2.10 Exercises
Join our community Discord space
Chapter 3: Functions, Iterators, and GeneratorsChevron down iconChevron up icon
Chapter 3: Functions, Iterators, and Generators
3.1 Writing pure functions
3.2 Functions as first-class objects
3.3 Using strings
3.4 Using tuples and named tuples
3.5 Using generator expressions
3.6 Cleaning raw data with generator functions
3.7 Applying generators to built-in collections
3.8 Summary
3.9 Exercises
Join our community Discord space
Chapter 4: Working with CollectionsChevron down iconChevron up icon
Chapter 4: Working with Collections
4.1 An overview of function varieties
4.2 Working with iterables
4.3 Using any() and all() as reductions
4.4 Using len() and sum() on collections
4.5 Using zip() to structure and flatten sequences
4.6 Using sorted() and reversed() to change the order
4.7 Using enumerate() to include a sequence number
4.8 Summary
4.9 Exercises
Join our community Discord space
Chapter 5: Higher-Order FunctionsChevron down iconChevron up icon
Chapter 5: Higher-Order Functions
5.1 Using max() and min() to find extrema
5.2 Using the map() function to apply a function to a collection
5.3 Using the filter() function to pass or reject data
5.4 The iter() function with a sentinel value
5.5 Using sorted() to put data in order
5.6 Overview of writing higher-order functions
5.7 Writing higher-order mappings and filters
5.8 Building higher-order functions with callables
5.9 Review of some design patterns
5.10 Summary
5.11 Exercises
Join our community Discord space
Chapter 6: Recursions and ReductionsChevron down iconChevron up icon
Chapter 6: Recursions and Reductions
6.1 Simple numerical recursions
6.2 Reductions and folding a collection from many items to one
6.3 Group-by reduction from many items to fewer
6.4 Summary
6.5 Exercises
Join our community Discord space
Chapter 7: Complex Stateless ObjectsChevron down iconChevron up icon
Chapter 7: Complex Stateless Objects
7.1 Using tuples to collect data
7.2 Using NamedTuple to collect data
7.3 Using frozen dataclasses to collect data
7.4 Complicated object initialization and property computations
7.5 Using pyrsistent to collect data
7.6 Avoiding stateful classes by using families of tuples
7.7 Polymorphism and type pattern matching
7.8 Summary
7.9 Exercises
Join our community Discord space
Chapter 8: The Itertools ModuleChevron down iconChevron up icon
Chapter 8: The Itertools Module
8.1 Working with the infinite iterators
8.2 Using the finite iterators
8.3 Cloning iterators with tee()
8.4 The itertools recipes
8.5 Summary
8.6 Exercises
Join our community Discord space
Chapter 9: Itertools for Combinatorics – Permutations and CombinationsChevron down iconChevron up icon
Chapter 9: Itertools for Combinatorics – Permutations and Combinations
9.1 Enumerating the Cartesian product
9.2 Reducing a product
9.3 Performance improvements
9.4 Permuting a collection of values
9.5 Generating all combinations
9.6 Recipes
9.7 Summary
9.8 Exercises
Join our community Discord space
Chapter 10: The Functools ModuleChevron down iconChevron up icon
Chapter 10: The Functools Module
10.1 Function tools
10.2 Memoizing previous results with cache
10.3 Defining classes with total ordering
10.4 Applying partial arguments with partial()
10.5 Reducing sets of data with the reduce() function
10.6 Handling multiple types with singledispatch
10.7 Summary
10.8 Exercises
Join our community Discord space
Chapter 11: The Toolz PackageChevron down iconChevron up icon
Chapter 11: The Toolz Package
11.1 The itertools star map function
11.2 Reducing with operator module functions
11.3 Using the toolz package
11.4 Summary
11.5 Exercises
Chapter 12: Decorator Design TechniquesChevron down iconChevron up icon
Chapter 12: Decorator Design Techniques
12.1 Decorators as higher-order functions
12.2 Cross-cutting concerns
12.3 Composite design
12.4 Adding a parameter to a decorator
12.5 Implementing more complex decorators
12.6 Complicated design considerations
12.7 Summary
12.8 Exercises
Chapter 13: The PyMonad LibraryChevron down iconChevron up icon
Chapter 13: The PyMonad Library
13.1 Downloading and installing
13.2 Functional composition and currying
13.3 Functors – making everything a function
13.4 Monad bind() function
13.5 Implementing simulation with monads
13.6 Additional PyMonad features
13.7 Summary
13.8 Exercises
Join our community Discord space
Chapter 14: The Multiprocessing, Threading, and Concurrent.Futures ModulesChevron down iconChevron up icon
Chapter 14: The Multiprocessing, Threading, and Concurrent.Futures Modules
14.1 Functional programming and concurrency
14.2 What concurrency really means
14.3 Using multiprocessing pools and tasks
14.4 Using a multiprocessing pool for concurrent processing
14.5 Summary
14.6 Exercises
Chapter 15: A Functional Approach to Web ServicesChevron down iconChevron up icon
Chapter 15: A Functional Approach to Web Services
15.1 The HTTP request-response model
15.2 The WSGI standard
15.3 Defining web services as functions
15.4 Tracking usage
15.5 Summary
15.6 Exercises
Join our community Discord space
Other Books You Might EnjoyChevron down iconChevron up icon
Other Books You Might Enjoy
IndexChevron down iconChevron up icon
Index

Recommendations for you

Left arrow icon
Debunking C++ Myths
Debunking C++ Myths
Read more
Dec 2024226 pages
Full star icon5 (1)
eBook
eBook
€8.98€23.99
€29.99
Go Recipes for Developers
Go Recipes for Developers
Read more
Dec 2024350 pages
eBook
eBook
€8.98€23.99
€29.99
50 Algorithms Every Programmer Should Know
50 Algorithms Every Programmer Should Know
Read more
Sep 2023538 pages
Full star icon4.5 (64)
eBook
eBook
€8.98€29.99
€37.99
€37.99
Asynchronous Programming with C++
Asynchronous Programming with C++
Read more
Nov 2024424 pages
Full star icon5 (1)
eBook
eBook
€8.98€25.99
€31.99
Modern CMake for C++
Modern CMake for C++
Read more
May 2024504 pages
Full star icon4.7 (13)
eBook
eBook
€8.98€29.99
€37.99
Learn Python Programming
Learn Python Programming
Read more
Nov 2024616 pages
Full star icon3.5 (2)
eBook
eBook
€8.98€23.99
€29.99
Learn to Code with Rust
Learn to Code with Rust
Read more
Sep 202557hrs 40mins
Full star icon5 (1)
Video
Video
€8.98€56.99
Modern Python Cookbook
Modern Python Cookbook
Read more
Jul 2024818 pages
Full star icon4.9 (17)
eBook
eBook
€8.98€32.99
€41.99
Right arrow icon

Customer reviews

Top Reviews
Rating distribution
Full star iconFull star iconFull star iconFull star iconHalf star icon4.5
(28 Ratings)
5 star71.4%
4 star17.9%
3 star3.6%
2 star0%
1 star7.1%
Filter icon Filter
Top Reviews

Filter reviews by




Carlos Andres JaramilloFeb 21, 2023
Full star iconFull star iconFull star iconFull star iconFull star icon5
The book Functional Python Programming is an excellent book for anyone who wants to deepen their learning of Python, with very clear examples and challenging exercises the author fills the reader with a deep understanding of this wonderful programming language. I highly recommend this book for people who want to acquire a Senior level in Python or who want to optimize their algorithms at the enterprise level.El libro Functional Python Programming, es un excelente libro para todo el que quiera profundizar en el aprendizaje de Python, con ejemplos muy claros y ejercicios retadores el autor va llenando al lector a una comprensión profunda de este maravilloso lenguaje de programación. Recomiendo mucho este libro para las personas que desean adquirir un nivel Senior en Python o que quieren optimizar sus algoritmos a nivel empresarial.
Amazon Verified reviewAmazon
MichaelJan 03, 2023
Full star iconFull star iconFull star iconFull star iconFull star icon5
This Book strengthened my ability to exploit pythons facilities for functional programming. Taking a more functional approach sometimes you can get a lot more done. Then when you combine that with the OOP is a whole new world!
Amazon Verified reviewAmazon
srikarJan 12, 2023
Full star iconFull star iconFull star iconFull star iconFull star icon5
This book explains excellent explanation on functional programming concept. This book is not intended for beginner students. For anyone who wants to read this book must have solid python understanding and working experience.The author covered functional programming with python for almost all the major topics in programming such as multi threading and also other topics such as web services which gives an excellent insight on how to use functional programming with python. The exercises are also good which gives good insight on some of the edge case problems. Overall it's an excellent read for an experienced programmer.
Amazon Verified reviewAmazon
Andre P.Feb 04, 2023
Full star iconFull star iconFull star iconFull star iconFull star icon5
The book provides a smooth introduction to the world of functional programming. It illustrates the core concepts of functional programming (like high-order functions, decorators, generators and iterators) and shows how it’s possible to leverage standard library modules (like IterTools and FuncTools, for instance) to simplify the task of writing functional code. The book has plenty of code samples (which are available on GitHub) that make it really easy to understand and follow the content. I would highly recommend it to anybody looking to familiarize themselves with functional programming.My personal book highlights are:✔️ Higher-Order Functions✔️ Decorator Design Techniques✔️ The Multiprocessing, Threading, and Concurrent.Futures Modules✔️ A Functional Approach to Web Services
Amazon Verified reviewAmazon
vJan 06, 2023
Full star iconFull star iconFull star iconFull star iconFull star icon5
This book covers many important topics for functional programming in python from intermediate to advanced levels. Both junior (with some python basis) and senior readers can find useful information from the book. As well, this book also provides good examples for readers.
Amazon Verified reviewAmazon
  • Arrow left icon Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • ...
  • Arrow right icon Next

People who bought this also bought

Left arrow icon
50 Algorithms Every Programmer Should Know
50 Algorithms Every Programmer Should Know
Read more
Sep 2023538 pages
Full star icon4.5 (64)
eBook
eBook
€8.98€29.99
€37.99
€37.99
Event-Driven Architecture in Golang
Event-Driven Architecture in Golang
Read more
Nov 2022384 pages
Full star icon4.9 (10)
eBook
eBook
€8.98€29.99
€37.99
€33.99
The Python Workshop Second Edition
The Python Workshop Second Edition
Read more
Nov 2022600 pages
Full star icon4.6 (19)
eBook
eBook
€8.98€31.99
€38.99
Template Metaprogramming with C++
Template Metaprogramming with C++
Read more
Aug 2022480 pages
Full star icon4.6 (13)
eBook
eBook
€8.98€28.99
€35.99
Domain-Driven Design with Golang
Domain-Driven Design with Golang
Read more
Dec 2022204 pages
Full star icon4.4 (18)
eBook
eBook
€8.98€26.99
€33.99
Right arrow icon

About the author

Profile icon Steven F. Lott
Steven F. Lott
LinkedIn icon
Steven Lott has been programming since computers were large, expensive, and rare. Working for decades in high tech has given him exposure to a lot of ideas and techniques, some bad, but most are helpful to others. Since the 1990s, Steven has been engaged with Python, crafting an array of indispensable tools and applications. His profound expertise has led him to contribute significantly to Packt Publishing, penning notable titles like "Mastering Object-Oriented," "The Modern Python Cookbook," and "Functional Python Programming." A self-proclaimed technomad, Steven's unconventional lifestyle sees him residing on a boat, often anchored along the vibrant east coast of the US. He tries to live by the words &ldquo;Don't come home until you have a story.&rdquo;
Read more
See other products by Steven F. Lott
Getfree access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook?Chevron down iconChevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website?Chevron down iconChevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook?Chevron down iconChevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support?Chevron down iconChevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks?Chevron down iconChevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook?Chevron down iconChevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Create a Free Account To Continue Reading

Modal Close icon
OR
    First name is required.
    Last name is required.

The Password should contain at least :

  • 8 characters
  • 1 uppercase
  • 1 number
Notify me about special offers, personalized product recommendations, and learning tips By signing up for the free trial you will receive emails related to this service, you can unsubscribe at any time
By clicking ‘Create Account’, you are agreeing to ourPrivacy Policy andTerms & Conditions
Already have an account? SIGN IN

Sign in to activate your 7-day free access

Modal Close icon
OR
By redeeming the free trial you will receive emails related to this service, you can unsubscribe at any time.

[8]ページ先頭

©2009-2025 Movatter.jp