Index
A
- Accretion design pattern / Working with iterables
- accumulate() function
- about / Using the finite iterators
- totals, executing / Running totals with accumulate()
- accuracy
- optimizing / Optimizing accuracy
- reducing, based on audience requirements / Reducing accuracy based on audience requirements
- API Key
- usage, tracking / Tracking usage
- Application Program Interface (API) / Familiar territory
- applicative functors / Functors and applicative functors
- apply() function
- used, for creating single request / Using apply() to make a single request
- apply_async() function
B
- Big-O analysis / Combining two transformations
- Big O / Optimizing storage
- Binary Right Shift operator / Monad bind() function and the >> operator
- bind() function / Monad bind() function and the >> operator
- bisect module
- used, for creating mapping / Using the bisect module to create a mapping
- Blackjack casino / Defining classes with total ordering
C
- caching / Memoization and caching
- Callable hint
- reference / Decorators as higher-order functions
- callable objects
- reference / Preprocessing bad data
- callables
- used, for building higher-order functions / Building higher-order functions with callables
- Cartesian product
- enumerating / Enumerating the Cartesian product
- reducing / Reducing a product
- distances, computing / Computing distances
- pixels, obtaining / Getting all pixels and all colors
- colors, obtaining / Getting all pixels and all colors
- performance analysis / Performance analysis
- problem, rearranging / Rearranging the problem
- transformations, combining / Combining two transformations
- chain() function
- about / Using the finite iterators
- iterators, combining / Combining iterators with chain()
- chi-squared decision
- case study / Case study–making a chi-squared decision
- raw data, reducing with Counter object / Filtering and reducing the raw data with a Counter object
- raw data, filtering with Counter object / Filtering and reducing the raw data with a Counter object
- summarized data, reading / Reading summarized data
- sums, computing with Counter object / Computing sums with a Counter object
- probabilities, computing from Counter object / Computing probabilities from Counter objects
- expected values, computing / Computing expected values and displaying a contingency table
- contingency table, displaying / Computing expected values and displaying a contingency table
- chi-squared value, computing / Computing the chi-squared value
- chi-squared threshold, computing / Computing the chi-squared threshold
- incomplete gamma function, computing / Computing the incomplete gamma function
- complete gamma function, computing / Computing the complete gamma function
- odds of distribution being random, computing / Computing the odds of a distribution being random
- chi-squared distribution
- chroma-key
- reference / Using stateful sets
- about / Using stateful sets
- classes
- defining, with @total_ordering decorator / Defining classes with total ordering
- number classes, defining / Defining number classes
- Clojure / Using lists, dicts, and sets
- closures / Functional programming design patterns
- collection
- map() function, used for applying function / Using the map() function to apply a function to a collection
- collection functions
- about / An overview of function varieties
- reduction / An overview of function varieties
- mapping / An overview of function varieties
- filter / An overview of function varieties
- collection of values
- permuting / Permuting a collection of values
- combinations
- generating / Generating all combinations
- combinatorial optimization
- reference / Permuting a collection of values
- Comma Separated Values (CSV) / Parsing an XML file
- Common Log Format (CLF) / Processing many large files
- Communicating Sequential Processes (CSP) / Where benefits will accrue
- complex decorators
- implementing / Implementing more complex decorators
- complex design
- considerations / Complex design considerations
- composite design
- about / Composite design
- bad data, preprocessing / Preprocessing bad data
- compress() function
- about / Using the finite iterators
- filtering with / Filtering with compress()
- concurrency
- in functional programming / Functional programming and concurrency
- about / What concurrency really means
- boundary conditions / The boundary conditions
- resources, sharing with process or threads / Sharing resources with process or threads
- benefits / Where benefits will accrue
- concurrent.futures module
- using / Using the concurrent.futures module
- thread pools, using / Using concurrent.futures thread pools
- concurrent processing
- with multiprocessing pools / Using a multiprocessing pool for concurrent processing
- designing / Designing concurrent processing
- conditional expressions
- evaluating / Evaluating conditional expressions
- non-strict dictionary rules, exploiting / Exploiting non-strict dictionary rules
- filtering / Filtering true conditional expressions
- matching pattern, searching / Finding a matching pattern
- count() function
- about / Working with the infinite iterators
- used, for counting / Counting with count()
- with float arguments / Counting with float arguments
- Counter
- used, for building mapping / Building a mapping with Counter
- Cross-Site Request Forgeries (CSRF) / Nesting the services
- Cumulative Distribution Function (CDF) / Reducing accuracy based on audience requirements
- curl / The HTTP request-response model
- currying
- about / Learning some advanced concepts, Lambdas and the lambda calculus, Functional composition and currying, Functional programming design patterns
- curried higher-order functions, using / Using curried higher-order functions
- manually / Currying the hard way
- cycle() function
- about / Working with the infinite iterators
- cycle, re-iterating / Re-iterating a cycle with cycle()
D
- data
- passing/rejecting, filter () function used / Using the filter() function to pass or reject data
- ordering, with sorted() function / Using sorted() to put data in order
- unwrapping, while mapping / Unwrapping data while mapping
- additional data, wrapping while mapping / Wrapping additional data while mapping
- flattening, while mapping / Flattening data while mapping
- structuring, while filtering / Structuring data while filtering
- grouping or partitioning, by key values / Grouping or partitioning data by key values
- collecting, with tuples / Using tuples to collect data
- collecting, with named tuples / Using named tuples to collect data
- decorator
- defining, as higher-order functions / Decorators as higher-order functions
- update_wrapper() function, using / Using the functools update_wrapper() functions
- cross-cutting concerns / Cross-cutting concerns
- parameter, adding / Adding a parameter to a decorator
- complex decorators, implementing / Implementing more complex decorators
- design patterns
- generator, returning / Review of some design patterns
- generator, returning as / Review of some design patterns
- generator, acting as / Review of some design patterns
- collection, materializing / Review of some design patterns
- scalar / Review of some design patterns
- dicts
- using / Using lists, dicts, and sets
- double factorial / Filtering true conditional expressions
- dropwhile() function
- about / Using the finite iterators
- stateful filtering / Stateful filtering with dropwhile() and takewhile()
E
- enumerate() function
- used, for including sequence number / Using enumerate() to include a sequence number
- about / Using the finite iterators
- numbers, assigning / Assigning numbers with enumerate()
- Epsilon / A classic example of functional programming
- Euclidean distance / Computing distances
- exploratory data analysis (EDA)
- about / Exploratory data analysis, Case study–making a chi-squared decision
- data preparation / Exploratory data analysis
- data exploration / Exploratory data analysis
- data modeling and machine learning / Exploratory data analysis
- evaluation and comparison / Exploratory data analysis
- Extensible Markup Language (XML) file
- parsing / Parsing an XML file
- parsing, at higher level / Parsing a file at a higher level
F
- familiar territory / Familiar territory
- file parsers
- writing / Writing file parsers
- CSV files, parsing / Parsing CSV files
- plain text files with headers, parsing / Parsing plain text files with headers
- filter() function
- used, for passing/rejecting data / Using the filter() function to pass or reject data
- used, for identifying outliers / Using filter() to identify outliers
- filterfalse() function
- about / Using the finite iterators
- filtering with / Two approaches to filtering with filterfalse() and filter()
- versus filter() function / Two approaches to filtering with filterfalse() and filter()
- finite iterators
- using / Using the finite iterators
- enumerate() function / Using the finite iterators
- accumulate() function / Using the finite iterators
- chain() function / Using the finite iterators
- groupby() function / Using the finite iterators
- zip_longest() function / Using the finite iterators
- compress() function / Using the finite iterators
- islice() function / Using the finite iterators
- dropwhile() function / Using the finite iterators
- takewhile() function / Using the finite iterators
- filterfalse() function / Using the finite iterators
- starmap() function / Using the finite iterators
- first-class functions
- about / First-class functions
- pure functions / Pure functions
- higher-order functions / Higher-order functions
- fizz-buzz problems
- reference / Re-iterating a cycle with cycle()
- flat sequences
- Fortran code / A classic example of functional programming
- functional composition
- currying / Functional composition and currying
- with PyMonad multiplication operator / Functional composition and the PyMonad * operator
- functional constructors
- named tuples, building / Building named tuples with functional constructors
- functional programming
- about / Identifying a paradigm
- example / A classic example of functional programming
- reference / A classic example of functional programming
- concurrency / Functional programming and concurrency
- design patterns / Functional programming design patterns
- functional type systems / Functional type systems
- function composition / Functional programming design patterns
- functions
- using, as first-class objects / Functions as first-class objects
- web services, defining as / Defining web services as functions
- function tools / Function tools
- function varieties
- overview / An overview of function varieties
- functools
- update_wrapper() function, using / Using the functools update_wrapper() functions
- functors
- about / Functors and applicative functors
- applicative functors / Functors and applicative functors
- lazy List() functor, using / Using the lazy List() functor
G
- generator expressions
- using / Using generator expressions
- limitations, exploring / Exploring the limitations of generators
- combining / Combining generator expressions
- applying, to scalar functions / Applying generator expressions to scalar functions
- generator functions
- used, for cleaning raw data / Cleaning raw data with generator functions
- writing / Writing generator functions
- GNU Image Manipulation Program (GIMP) / Using stateful mappings
- group-by reduction
- groupby() function
- about / Using the finite iterators
- iterator, partitioning / Partitioning an iterator with groupby()
- and reduce() function, using / Using the groupby() and reduce() functions
H
- higher-order filters
- higher-order functions
- about / Higher-order functions, Functional programming design patterns
- using / Immutable data
- writing / Writing higher-order functions
- building, with callables / Building higher-order functions with callables
- building, with good functional design / Assuring good functional design
- decorator, defining as / Decorators as higher-order functions
- named attributes, obtaining / Getting named attributes when using higher-order functions
- higher-order mappings
- higher-order reductions
- writing / Writing higher-order reductions
- httpd / Pragmatic WSGI applications, Creating the WSGI application
- HTTP request-response model
- about / The HTTP request-response model
- state, injecting through cookies / Injecting state through cookies
- server, considering with functional design / Considering a server with a functional design
- functional view / Looking more deeply into the functional view
- services, nesting / Nesting the services
- hybrid functional version / Using a functional hybrid
I
- immutable data / Immutable data
- imperative programming / Identifying a paradigm
- infinite iterators
- about / Working with the infinite iterators
- count() function / Working with the infinite iterators
- cycle() function / Working with the infinite iterators
- repeat() function / Working with the infinite iterators
- integration testing / Tail recursion optimizations
- islice() function
- about / Using the finite iterators
- subsets, selecting / Picking subsets with islice()
- iter() function
- using, with sentinel value / The iter() function with a sentinel value
- iterables
- working with / Working with iterables
- Extensible Markup Language (XML) file, parsing / Parsing an XML file
- items, pairing up from sequence / Pairing up items from a sequence
- iter() function, using explicitly / Using the iter() function explicitly
- simple loop, extending / Extending a simple loop
- generator expressions, applying to scalar functions / Applying generator expressions to scalar functions
- any(), using as reductions / Using any() and all() as reductions
- all(), using as reductions / Using any() and all() as reductions
- sum(), using / Using len() and sum()
- len(), using / Using len() and sum()
- sums and counts, using as statistics / Using sums and counts for statistics
- merging, with zip_longest() function / Merging iterables with zip_longest() and zip()
- merging, with zip() function / Merging iterables with zip_longest() and zip()
- iterators
- combining, with chain() function / Combining iterators with chain()
- partitioning, with groupby() function / Partitioning an iterator with groupby()
- cloning, with tee() function / Cloning iterators with tee()
- itertools module
- infinite iterators / Working with the infinite iterators
- finite iterators / Using the finite iterators
- Itertools Recipes
- reference / The itertools recipes, Recipes
- about / The itertools recipes
- take() function / The itertools recipes
- tabulate() function / The itertools recipes
- consume() function / The itertools recipes
- nth() function / The itertools recipes
- quantify() function / The itertools recipes
- padnone() function / The itertools recipes
- ncycles() function / The itertools recipes
- dotproduct() function / The itertools recipes
- flatten() function / The itertools recipes
- repeatfunc() function / The itertools recipes
- pairwise() function / The itertools recipes
- grouper() function / The itertools recipes
- roundrobin() function / The itertools recipes
- partition() function / The itertools recipes
- unique_everseen() function / The itertools recipes
- unique_justseen() function / The itertools recipes
- iter_except() function / The itertools recipes
- powerset() function / Recipes
- random_product() function / Recipes
- random_permutation() function / Recipes
- random_combination() function / Recipes
- itsdangerous package
- using / Tracking usage
- reference / Tracking usage
J
- JavaScript Object Notation (JSON) / Parsing a file at a higher level
K
- Keyhole Markup Language (KML) / Parsing an XML file
L
- @lru_cache decorator
- previous results, memoizing / Memoizing previous results with lru_cache
- lambda calculus / Lambdas and the lambda calculus
- lambda forms
- working with / Working with lambda forms and map()
- lambdas / Lambdas and the lambda calculus
- lazy ("non-strict") evaluation / Functional programming design patterns
- lazy List() functor
- using / Using the lazy List() functor
- Least Recently Used (LRU) / Memoizing previous results with lru_cache
- lists
- using / Using lists, dicts, and sets
M
- Manhattan distance / Computing distances
- map() function
- used, for applying function to collection / Using the map() function to apply a function to a collection
- working with / Working with lambda forms and map()
- using, with multiple sequences / Using map() with multiple sequences
- function, applying to data / Applying a function to data via starmap() and map()
- combining, with reduce() function / Combining map() and reduce()
- and reduce function, used for sanitizing raw data / Using the map() and reduce() functions to sanitize raw data
- map-reduce algorithms / Functional programming design patterns
- mapping
- creating, bisect module used / Using the bisect module to create a mapping
- building, by sorting / Building a mapping by sorting
- map_async() function
- max() function
- used, for finding extrema / Using max() and min() to find extrema
- memoization
- about / Memoization and caching
- specializing / Specializing memoization
- memory writes
- reference / Sharing resources with process or threads
- min() function
- used, for finding extrema / Using max() and min() to find extrema
- monad
- about / Learning some advanced concepts, Functional programming design patterns
- bind() function / Monad bind() function and the >> operator
- simulation, implementing / Implementing simulation with monads
- monoid / Additional PyMonad features
- multiple-regression-based model
- reference / Functional composition and currying
- multiple tuples
- used, for avoiding stateful classes / Avoiding stateful classes by using families of tuples
- Spearman rank correlation / Avoiding stateful classes by using families of tuples
- multiplication operator, PyMonad package / Functional composition and the PyMonad * operator
- multiprocessing pools
- using / Using multiprocessing pools and tasks
- multiple large files, processing / Processing many large files
- log files, parsing / Parsing log files – gathering the rows
- log lines, parsing into namedtuples / Parsing log lines into namedtuples
- additional fields, parsing of Access object / Parsing additional fields of an Access object
- access details, filtering / Filtering the access details
- access details, analyzing / Analyzing the access details
- analysis process / The complete analysis process
- used, for concurrent processing / Using a multiprocessing pool for concurrent processing
- apply() function, used for creating single request / Using apply() to make a single request
- map_async() function, using / Using the map_async(), starmap_async(), and apply_async() functions
- starmap_async() function, using / Using the map_async(), starmap_async(), and apply_async() functions
- apply_async() function, using / Using the map_async(), starmap_async(), and apply_async() functions
- complex multiprocessing architectures / More complex multiprocessing architectures
- concurrent.futures module, using / Using the concurrent.futures module
- concurrent.futures thread pools, using / Using concurrent.futures thread pools
- threading modules, using / Using the threading and queue modules
- queue modules, using / Using the threading and queue modules
- concurrent processing, designing / Designing concurrent processing
- Multipurpose Internet Mail Extension (MIME) / Looking more deeply into the functional view
- mypy tool / Grouping or partitioning data by key values, Using tuples to collect data
N
- named attributes
- obtaining, from higher-order functions / Getting named attributes when using higher-order functions
- named tuples
- using / Using tuples and named tuples
- used, for collecting data / Using named tuples to collect data
- building, with functional constructors / Building named tuples with functional constructors
- Nginx / Pragmatic WSGI applications, Creating the WSGI application
- non-strict dictionary rules
- exploiting / Exploiting non-strict dictionary rules
- non-strict evaluation / Strict and non-strict evaluation
- number classes
- defining / Defining number classes
- numerical recursions
- about / Simple numerical recursions
- tail-call optimization, implementing / Implementing tail-call optimization
- recursion, leaving in place / Leaving recursion in place
- difficult tail-call optimization, handling / Handling difficult tail-call optimization
- collections, processing via / Processing collections through recursion
- tail-call optimization / Tail-call optimization for collections
- collections, folding from many items to one / Reductions and folding a collection from many items to one
O
- Object-Oriented Programming (OOP) / Subdividing the procedural paradigm, Immutable data
- operator module
- using, instead of lambdas / Using the operator module instead of lambdas
- named attributes, obtaining from higher-order functions / Getting named attributes when using higher-order functions
- operator module functions
- used, for reducing / Reducing with operator module functions
- operators
- used, for starmapping / Starmapping with operators
- outliers
- identifying, filter() function used / Using filter() to identify outliers
P
- paradigm
- identifying / Identifying a paradigm
- parallelism / Wrapping instead of state changing
- parameter
- adding, to decorator / Adding a parameter to a decorator
- parameterized decorator
- cr_decorator function / Adding a parameter to a decorator
- wrap_char_remove function / Adding a parameter to a decorator
- partial() function
- partial arguments, applying / Applying partial arguments with partial()
- and reduce() function, using / Using the reduce() and partial() functions
- partial application / Applying partial arguments with partial()
- Peano axioms
- reference / Simple numerical recursions
- Pillow project
- reference / Reducing a product
- polymorphism / Polymorphism and type-pattern matching
- pragmatic WSGI applications / Pragmatic WSGI applications
- procedural paradigm
- subdividing / Subdividing the procedural paradigm
- functional paradigm, using / Using the functional paradigm
- functional hybrid, using / Using a functional hybrid
- object creation, viewing / Looking at object creation
- stack of turtles / The stack of turtles
- pure functions
- about / Pure functions, Functional programming design patterns
- writing / Writing pure functions
- pycsp package
- PyMonad package
- URL / Downloading and installing
- installing / Downloading and installing
- downloading / Downloading and installing
- multiplication operator / Functional composition and the PyMonad * operator
- additional features / Additional PyMonad features
- Python Imaging Library (PIL) package / Reducing a product
- Python lambda forms
- using / Using Python lambda forms
- Python Package Index (PyPi) / Downloading and installing
- Python Standard Library / Merging iterables with zip_longest() and zip()
Q
- queue module
R
- raw data
- sanitizing, with map() and reduce() functions / Using the map() and reduce() functions to sanitize raw data
- recursion
- about / Recursion instead of an explicit loop state
- optimizing / Tail recursion optimizations
- reduce() function
- sets of data, reducing / Reducing sets of data with the reduce() function
- combining, with map() function / Combining map() and reduce()
- and partial() function, using / Using the reduce() and partial() functions
- and map() function, used for sanitizing raw data / Using the map() and reduce() functions to sanitize raw data
- and groupby() function, using / Using the groupby() and reduce() functions
- referential transparency / Learning some advanced concepts
- Regular Expression's (REs) / The WSGI standard
- repeat() function
- about / Working with the infinite iterators
- single value, repeating / Repeating a single value with repeat()
- resources
- sharing, with process or threads / Sharing resources with process or threads
- reversed() function
- used, for modifying order / Using reversed() to change the order
S
- scalar functions / An overview of function varieties
- Secured Socket Layer (SSL) protocol / Injecting state through cookies
- selector functions / Avoiding stateful classes by using families of tuples
- sequence number
- including, enumerate () function used / Using enumerate() to include a sequence number
- sequences
- flattening / Flattening sequences
- serialism / Wrapping instead of state changing
- sets
- using / Using lists, dicts, and sets
- simulation
- implementing, with monad / Implementing simulation with monads
- sorted() function
- used, for arranging data / Using sorted() to put data in order
- space-time trade off
- reference / Optimizing storage
- Spearman rank correlation
- reference / Avoiding stateful classes by using families of tuples
- about / Avoiding stateful classes by using families of tuples
- statistical ranks, assigning / Assigning statistical ranks
- wrapping / Wrapping instead of state changing
- rewrapping / Rewrapping instead of state changing
- computing / Computing Spearman rank-order correlation
- star-map processing / Using map() with multiple sequences
- starmap() function
- about / Using the finite iterators
- function, applying to data / Applying a function to data via starmap() and map()
- versus map() function / Applying a function to data via starmap() and map()
- starmapping
- with operators / Starmapping with operators
- starmap_async() function
- stateful classes
- avoiding, with multiple tuples / Avoiding stateful classes by using families of tuples
- stateful mappings
- using / Using stateful mappings
- stateful sets
- using / Using stateful sets
- storage
- optimizing / Optimizing storage
- strict evaluation / Strict and non-strict evaluation
- strings
- using / Using strings
T
- @total_ordering decorator
- classes, defining / Defining classes with total ordering
- Tail Call Optimization (TCO) / Recursion instead of an explicit loop state
- tail recursion
- about / Recursion instead of an explicit loop state
- optimizations / Tail recursion optimizations
- takewhile() function
- about / Using the finite iterators
- stateful filtering / Stateful filtering with dropwhile() and takewhile()
- tasks
- tee() function
- iterators, cloning / Cloning iterators with tee()
- threading module
- tuples
- using / Using tuples and named tuples
- used, for collecting data / Using tuples to collect data
- type-pattern matching / Polymorphism and type-pattern matching
U
- Universally Unique Identifier (UUID) / Tracking usage
- update_wrapper() function
- usage
- tracking, with API Key / Tracking usage
W
- Web Server Gateway Interface (WSGI)
- about / The WSGI standard
- references / The WSGI standard, Pragmatic WSGI applications
- exceptions, throwing during WSGI processing / Throwing exceptions during WSGI processing
- pragmatic WSGI applications / Pragmatic WSGI applications
- web services
- defining, as functions / Defining web services as functions
- WSGI application, creating / Creating the WSGI application
- wget / The HTTP request-response model
- wrap-process-unwrap pattern
- using / Immutable data
- Wrap-Unwrap design pattern / Avoiding stateful classes by using families of tuples
- WSGI application
- creating / Creating the WSGI application
- raw data, obtaining / Getting raw data
- filter, applying / Applying a filter
- results, serializing / Serializing the results
- data, serializing into JSON format / Serializing data into JSON or CSV formats
- data, serializing into CSV format / Serializing data into JSON or CSV formats
- data, serializing into XML / Serializing data into XML
- data, serializing into HTML / Serializing data into HTML
X
- x ranking / Rewrapping instead of state changing
Y
- y ranking / Rewrapping instead of state changing
Z
- zip() function
- used, for structuring sequences / Using zip() to structure and flatten sequences
- used, for flattening sequences / Using zip() to structure and flatten sequences
- zipped sequence
- unzipping / Unzipping a zipped sequence
- zip_longest() function
- about / Using the finite iterators
- iterables, merging / Merging iterables with zip_longest() and zip()
- versus zip() function / Merging iterables with zip_longest() and zip()