Index
A
- AccessDetails objects / Filtering the access details
- access_detail_iter() function / Processing many large files
- access_iter() function / Processing many large files
- accumulate() function
- about / Using the finite iterators, Running totals with accumulate()
- totals, running with / Running totals with accumulate()
- accuracy
- optimizing / Optimizing accuracy
- reducing, based on audience requirements / Reducing accuracy based on audience requirements
- alt_range() function / Functional composition and the PyMonad multiplication operator
- Anscombe's Quartet / Cleaning raw data with generator functions
- anscombe_filter() function / Creating the WSGI application
- Apache httpd / Pragmatic WSGI applications
- API Key
- usage, tracking / Tracking usage
- about / Tracking usage
- Application Program Interface (API) / Familiar territory
- attrgetter() function
B
- base case states / Using the functional paradigm
- bind() function
- binning / Group-by reductions – from many to fewer
- bisect module
- used, for creating mapping / Using the bisect module to create a mapping
- body mass index (BMI) / Functional composition and currying
- by_dist() function
C
- Callable class
- higher-order functions, building with / Building higher-order functions with Callables
- Callable class object
- about / Writing higher-order functions
- Cartesian product
- enumerating / Enumerating the Cartesian product
- CDF values
- chain() function
- about / Using the finite iterators, Combining iterators with chain()
- iterators, combining with / Combining iterators with chain()
- chi-squared decision
- making / Case study – making a chi-squared decision
- raw data, filtering with Counter object / Filtering and reducing the raw data with a Counter object
- raw data, reducing with Counter object / Filtering and reducing the raw data with a Counter object
- summarized data, reading / Reading summarized data
- probabilities, computing from Counter object / Computing probabilities from a Counter object
- alternative summary approaches / Alternative summary approaches
- chi-squared threshold
- computing / Computing the chi-squared threshold
- chi-squared value
- computing / Computing the chi-squared value
- chunking
- about / Flattening data while mapping
- classes
- defining, with total ordering / Defining classes with total ordering
- number classes, defining with total numbering / Defining number classes
- Clojure / Using lists, dicts, and sets
- collections.Counter method
- about / Building a mapping with Counter
- come_out_roll() function / Implementing simulation with monads
- Common Log Format (CLF) / Processing many large files
- Communicating Sequential Processes (CSP) / Where benefits will accrue
- complete gamma value
- computing / Computing the complete gamma value
- complex descriptors
- implementing / Implementing more complex descriptors
- complex multiprocessing architectures / More complex multiprocessing architectures
- composite analysis() function / The complete analysis process
- composite function
- about / Composite design
- bad data, preprocessing / Preprocessing bad data
- compress() function
- about / Using the finite iterators, Filtering with compress()
- filtering with / Filtering with compress()
- computation and I/O
- interleaving / Where benefits will accrue
- concurrency
- about / What concurrency really means
- concurrent.futures module
- concurrent.futures thread pools
- concurrent processing
- designing / Designing concurrent processing
- conditional expressions
- evaluating / Evaluating conditional expressions
- non-strict dictionary rules, exploiting / Exploiting non-strict dictionary rules
- true conditional expressions, filtering / Filtering true conditional expressions
- contingency table
- convert() function
- about / Unwrapping data while mapping
- count() function
- about / Counting with count()
- counting with / Counting with count()
- cross-cutting concerns
- about / Cross-cutting concerns
- Cross-Site Request Forgeries (CSRF) / Nesting the services
- csrf function / Nesting the services
- CSV serializer / Serializing data into the JSON or CSV format
- curl / The HTTP request-response model
- currency() function
- curried functions
- creating / Currying the hard way
- curried higher order functions
- currying / Saving some advanced concepts
- cycle() function
- about / Reiterating a cycle with cycle(), Repeating a single value with repeat()
- used, for reiterating cycle / Reiterating a cycle with cycle()
D
- decorator
- cross-cutting concerns / Cross-cutting concerns
- parameter, adding / Adding a parameter to a decorator
- design limitations, recognizing / Recognizing design limitations
- decorator function
- using, as higher-order functions / Decorators as higher-order functions
- about / Decorators as higher-order functions
- using / Decorators as higher-order functions
- design patterns
- dicts
- using / Using lists, dicts, and sets
- distance() function
- double factorial
- dropwhile() function
- about / Using the finite iterators, Stateful filtering with dropwhile() and takewhile()
- stateful filtering with / Stateful filtering with dropwhile() and takewhile()
E
- enumerate() function
- used, for including sequence number / Using enumerate() to include a sequence number
- about / Avoiding stateful classes by using families of tuples, Using the finite iterators, Assigning numbers with enumerate()
- numbers, assigning with / Assigning numbers with enumerate()
- Erlang / The stack of turtles
- example, functional programming / A classic example of functional programming
- expected values
- computing / 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
- partial gamma value, computing / Computing the partial gamma value
- complete gamma value, computing / Computing the complete gamma value
- CDF values, computing / Computing the odds of a distribution being random
- Exploratory Data Analysis (EDA)
- about / Exploratory Data Analysis
- stages / Exploratory Data Analysis
- Exploratory Data Analysis (EDA) application / Case study – making a chi-squared decision
F
- faster() function / Functions as first-class objects
- file parsers, reductions
- writing / Writing file parsers
- CSV files, parsing / Parsing CSV files
- plain text files, parsing with headers / Parsing plain text files with headers
- fillvalue parameter / Starmapping with operators
- filter() function
- about / Using the filter() function to pass or reject data
- used, for passing data / Using the filter() function to pass or reject data
- used, for rejecting data / Using the filter() function to pass or reject data
- used, for identifying outliers / Using filter() to identify outliers
- filtering with / Two approaches to filtering with filterfalse() and filter()
- using / Filtering true conditional expressions
- filterfalse() function
- finite iterators
- using / Using the finite iterators
- enumerate() / Using the finite iterators
- accumulate() / Using the finite iterators
- chain() / Using the finite iterators
- groupby() / Using the finite iterators
- zip_longest() / Using the finite iterators
- compress() / Using the finite iterators
- islice() / Using the finite iterators
- dropwhile() / Using the finite iterators
- takewhile() / Using the finite iterators
- filterfalse() / Using the finite iterators
- starmap() / Using the finite iterators
- enumerate(), used for assigning numbers / Assigning numbers with enumerate()
- accumulate(), used for running totals / Running totals with accumulate()
- chain(), used for combining iterators / Combining iterators with chain()
- groupby(), used for partitioning iterator / Partitioning an iterator with groupby()
- zip_longest(), used for merging iterables / Merging iterables with zip_longest() and zip()
- compress(), filtering with / Filtering with compress()
- islice(), subsets picking with / Picking subsets with islice()
- dropwhile(), stateful filtering with / Stateful filtering with dropwhile() and takewhile()
- takewhile(), stateful filtering with / Stateful filtering with dropwhile() and takewhile()
- filterfalse(), filtering with / Two approaches to filtering with filterfalse() and filter()
- filter(), filtering with / Two approaches to filtering with filterfalse() and filter()
- starmap(), used for applying function to data / Applying a function to data via starmap() and map()
- tee(), iterators cloning with / Cloning iterators with tee()
- first-class objects
- about / Functions as first-class objects
- first class functions
- about / First-class functions
- First Normal Form / Writing file parsers
- float_lat_lon() function / Writing file parsers
- Fortran code / A classic example of functional programming
- functional composition
- about / Functional composition and currying
- example / Functional composition and currying
- PyMonad multiplication operator, using / Functional composition and the PyMonad multiplication operator
- functional features
- first class functions / First-class functions
- pure functions / Pure functions
- higher-order functions / Higher-order functions
- immutable data / Immutable data
- strict evaluation / Strict and non-strict evaluation
- non-strict evaluation / Strict and non-strict evaluation
- recursion / Recursion instead of a explicit loop state
- functional type systems / Functional type systems
- familiar territory / Familiar territory
- advanced concepts / Saving some advanced concepts
- functional hybrid
- using / Using a functional hybrid
- functional paradigm
- using / Using the functional paradigm
- functional programming
- classic example / A classic example of functional programming
- functional type systems
- about / Functional type systems
- functions, as first-class objects
- about / Functions as first-class objects
- function tools
- about / Function tools
- functools.reduce() function / Reducing with operators, Using curried higher-order functions
- functools.wraps() function / Decorators as higher-order functions
- functor
- about / Functors and applicative functors
- applicative functors / Functors and applicative functors
G
- generator expressions
- using / Using generator expressions
- limitations / Exploring the limitations of generators
- combining / Combining generator expressions
- generator functions
- used, for cleaning raw data / Cleaning raw data with generator functions
- writing / Writing generator functions
- group() function
- about / Building a mapping by sorting
- group-by reductions
- from many to fewer / Group-by reductions – from many to fewer
- writing / Writing more general group-by reductions
- groupby() function
- about / Using the finite iterators, Partitioning an iterator with groupby()
- iterator, partitioning with / Partitioning an iterator with groupby()
H
- Haskell / The stack of turtles, Functional type systems
- higher-order functions
- about / Higher-order functions
- max() function / Using max() and min() to find extrema
- min() function / Using max() and min() to find extrema
- lambda forms / Using Python lambda forms
- map() function / Using the map() function to apply a function to a collection
- filter() function / Using the filter() function to pass or reject data
- iter() function / The iter() function with a sentinel value
- sorted() / Using sorted() to put data in order
- writing / Writing higher-order functions
- building, with Callables / Building higher-order functions with Callables
- good functional design, assuring / Assuring good functional design
- higher-order mappings and filters
- writing / Writing higher-order mappings and filters
- data, unwrapping while mapping / Unwrapping data while mapping
- additional data, wrapping while mapping / Wrapping additional data while mapping
- data, flattening while mapping / Flattening data while mapping
- data, structuring while filtering / Structuring data while filtering
- higher-order reductions
- writing / Writing higher-order reductions
- HTTP request-response model
- about / The HTTP request-response model
- state, injecting via cookies / Injecting a state via 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
I
- I/O and computation
- interleaving / Where benefits will accrue
- imap(function, iterable) method / Using a multiprocessing pool for concurrent processing
- imap_unordered(function, iterable) method / Using a multiprocessing pool for concurrent processing
- immutable namedtuple
- using, as record / Using an immutable namedtuple as a record
- using / 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
- Spearman rank-order correlation, computing / Computing the Spearman rank-order correlation
- immutable objects
- about / Immutable data
- Higher Order Functions, using / Immutable data
- Wrap-Process-Unwrap pattern, using / Immutable data
- infinite iterators
- working with / Working with the infinite iterators
- count() / Working with the infinite iterators
- cycle() / Working with the infinite iterators
- repeat() / Working with the infinite iterators
- count(), counting with / Counting with count()
- cycle(), used for reiterating cycle / Reiterating a cycle with cycle()
- repeat(), used for repeating single value / Repeating a single value with repeat()
- islice() function
- about / Using the finite iterators, Picking subsets with islice()
- subsets, picking with / Picking subsets with islice()
- itemgetter() function / Using the operator module instead of lambdas
- iter() function
- iterables
- working with / Working with iterables
- XML file, parsing / Parsing an XML file
- file, parsing at higher level / Parsing a file at a higher level
- items, picking up from sequence / Pairing up items from a sequence
- iter() function explicitly, using / 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() function, using / Using any() and all() as reductions
- all() function, using / Using any() and all() as reductions
- len() fucntion, using / Using len() and sum()
- sum() function, using / Using len() and sum()
- sums, using for statistics / Using sums and counts for statistics
- counts, using for statistics / Using sums and counts for statistics
- iterools module
- Cartesian product, enumerating / Enumerating the Cartesian product
- iterools recipes
- about / Recipes
- itertools.starmap() function
- about / Starmapping with operators
- itertools.zip_longest() function / Starmapping with operators
- itertools module
- finite iterators / Using the finite iterators
- all combinations, generating / Generating all combinations
- itertools recipes
- about / The itertools recipes
J
- Jinja2 templates / The WSGI standard
- JSON serializer / Serializing data into the JSON or CSV format
L
- lambda calculus
- about / Lambdas and the lambda calculus
- lambda forms
- working with / Working with lambda forms and map()
- lambdas
- about / Lambdas and the lambda calculus
- lazy List() functor
- using / Using the lazy List() functor
- lists
- about / Using lists, dicts, and sets
- using / Using lists, dicts, and sets
- local_gzip() function / Processing many large files
- LRU (Least Recently Used)
- lru_cache decorator
- used, for caching previous results / Memoizing previous results with lru_cache
- about / Memoizing previous results with lru_cache
M
- map() function
- using / Using the map() function to apply a function to a collection
- about / Using the map() function to apply a function to a collection
- working with / Working with lambda forms and map()
- using, with multiple sequence / Using map() with multiple sequences
- used, for applying function to data / Applying a function to data via starmap() and map()
- map(function, iterable) method / Using a multiprocessing pool for concurrent processing
- mapping
- creating, bisect module used / Using the bisect module to create a mapping
- building, with Counter / Building a mapping with Counter
- building, by sorting / Building a mapping by sorting
- max() function
- mean() function
- memoization
- about / Memoization and caching
- specializing / Specializing memoization
- min() function
- monad
- monads / Saving some advanced concepts
- monoid
- about / Additional PyMonad features
- multiprocessing application
- using / Using multiprocessing pools and tasks
- 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
- Access object fields, parsing / Parsing additional fields of an Access object
- access details, filtering / Filtering the access details
- access details, analyzing / Analyzing the access details
- complete analysis process / The complete analysis process
- multiprocessing module
- boundary conditions / The boundary conditions
- resources, sharing with process / Sharing resources with process or threads
- resources, sharing with threading / Sharing resources with process or threads
- multiprocessing pool, for concurrent processing
- using / Using a multiprocessing pool for concurrent processing
- apply(), used for making single request / Using apply() to make a single request
- map_async(), using / Using map_async(), starmap_async(), and apply_async()
- starmap_async(), using / Using map_async(), starmap_async(), and apply_async()
- apply_async() function, using / Using map_async(), starmap_async(), and apply_async()
- 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 module, using / Using the threading and queue modules
- queue module, 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
- multy() function / Functions as first-class objects
- myreduce() function / Using curried higher-order functions
N
- named attributes
- obtaining, when using higher order / Getting named attributes when using higher-order functions
- namedtuples
- using / Using tuples and namedtuples
- building, with functional constructors / Building namedtuples with functional constructors
- nested generator expressions / Using a functional hybrid
- Nginx / Pragmatic WSGI applications
- non-strict dictionary rules
- exploiting / Exploiting non-strict dictionary rules
- non-strict evaluation / Strict and non-strict evaluation
- null-aware round() function
- creating / Decorators as higher-order functions
- null_wrapper() function / Decorators as higher-order functions
- num variable
- about / Starmapping with operators
O
- Object-Oriented Programming (OOP) language / Immutable data
- OCaml / The stack of turtles
- operator module
- using / Using the operator module instead of lambdas
- named attributes, obtaining when using higher-order functions / Getting named attributes when using higher-order functions
- operators
- starmappping with / Starmapping with operators
- reducing with / Reducing with operators
- operators.truediv() function / Starmapping with operators
- optimization techniques
- memoization / Memoization and caching
- caching / Memoization and caching
- storage, optimizing / Optimizing storage
- accuracy, optimizing / Optimizing accuracy
P
- parallelism
- parameterized decorator
- about / Adding a parameter to a decorator
- overall decorator / Adding a parameter to a decorator
- abstract decorator / Adding a parameter to a decorator
- decorating wrapper / Adding a parameter to a decorator
- partial() function
- about / Applying partial arguments with partial()
- used, for applying partial arguments / Applying partial arguments with partial()
- partial arguments
- applying, with partial() / Applying partial arguments with partial()
- partial gamma value
- computing / Computing the partial gamma value
- path_filter() function / Filtering the access details
- PATH_INFO request / Creating the WSGI application
- Peano axioms
- about / Simple numerical recursions
- point_roll() function / Implementing simulation with monads
- polymorphism pattern matching
- powerset function / Recipes
- previous results
- caching, lru_cache decorator used / Memoizing previous results with lru_cache
- procedural paradigm
- subdividing / Subdividing the procedural paradigm
- functional paradigm, using / Using the functional paradigm
- functional hybrid, using / Using a functional hybrid
- object creation / Looking at object creation
- stacks of abstractions / The stack of turtles
- product, reducing
- about / Reducing a product
- distances, computing / Computing distances
- all pixels and all colors, enumerating / Getting all pixels and all colors
- performance analysis / Performance analysis
- problem, rearranging / Rearranging the problem
- transformations, combining / Combining two transformations
- collection of values, permuting / Permuting a collection of values
- programming paradigms
- identifying / Identifying a paradigm
- functional programming / Identifying a paradigm
- imperative programming / Identifying a paradigm
- pure functions
- about / Pure functions, Writing pure functions
- writing / Writing pure functions
- PyMonad
- features / Additional PyMonad features
- PyMonad * operator / Functional composition and the PyMonad multiplication operator
- PyMonad.List() function / Using the lazy List() functor
- PyMonad module
- about / Downloading and installing
- downloading / Downloading and installing
- installing / Downloading and installing
- URL / Downloading and installing
- PyMonad multiplication operator
- used, for functional composition / Functional composition and the PyMonad multiplication operator
- PyPi
- about / Writing generator functions
- Python
- Object-Oriented Programming (OOP) features / Subdividing the procedural paradigm
- Pythonic pattern matching
- 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 document / Merging iterables with zip_longest() and zip()
Q
- QUERY_STRING request / Creating the WSGI application
R
- random_combination function / Recipes
- random_permutation function / Recipes
- random_product function / Recipes
- rank() function
- about / Assigning statistical ranks
- raw data
- cleaning, with generator functions / Cleaning raw data with generator functions
- raw_data() function / Creating the WSGI application, Getting raw data
- read_head() function
- read_tail() function
- recursion
- recursive case states / Using the functional paradigm
- reduce() function
- about / Function tools
- used, for reducing sets of data / Reducing sets of data with reduce()
- combining, with map() function / Combining map() and reduce()
- partial() function, using with / Using reduce() and partial()
- used, for sanitizing raw data / Using map() and reduce() to sanitize raw data
- groupby(), using with / Using groupby() and reduce()
- reductions
- from many to one / Reductions and folding – from many to one
- group-by reductions / Group-by reductions – from many to fewer
- mapping, building with Counter / Building a mapping with Counter
- mapping, building by sorting / Building a mapping by sorting
- data, grouping by key values / Grouping or partitioning data by key values
- data, partitioning by key values / Grouping or partitioning data by key values
- group-by reduction, writing / Writing more general group-by reductions
- higher order reductions, writing / Writing higher-order reductions
- file parsers, writing / Writing file parsers
- referential transparency
- about / Saving some advanced concepts
- repeat() function
- about / Repeating a single value with repeat()
- used, for repeating single value / Repeating a single value with repeat()
- reversed() function
- used, for changing order / Using reversed() to change the order
- routing() function / The WSGI standard
S
- Scala / Functional type systems
- Secured Socket Layer (SSL) protocols / Injecting a state via cookies
- semifact() function
- serialism
- serialization
- about / Serializing the results
- sets
- using / Using lists, dicts, and sets
- shifty() function / Functions as first-class objects
- Sieve of Eratosthenes
- simple numerical recursions
- about / Simple numerical recursions
- tail-call optimization, implementing / Implementing tail-call optimization
- recursion, leaving in place / Leaving recursion in place, Handling difficult tail-call optimization
- collections, processing via recursion / Processing collections via recursion
- tail-call optimization, for collection / Tail-call optimization for collections
- simulation
- implementing, with monads / Implementing simulation with monads
- sorted() function
- used, for data sorting / Using sorted() to put data in order
- Spearman rank-order correlation
- stacks of abstractions
- about / The stack of turtles
- starmap() function
- about / Using the finite iterators, Applying a function to data via starmap() and map()
- used, for applying function to data / Applying a function to data via starmap() and map()
- starmap(function, iterable) method / Using a multiprocessing pool for concurrent processing
- start_response function / The WSGI standard
- stateful mappings
- using / Using stateful mappings
- stateful sets
- using / Using stateful sets
- stdev() function
- storage
- optimizing / Optimizing storage
- Strategy design pattern / Functions as first-class objects
- strict evaluation
- about / Strict and non-strict evaluation
- string.Template() function / Serializing data into HTML
- strings
- using / Using strings
- systolic_bp() function / Functors and applicative functors
T
- @then_convert(converter) style decorator / Recognizing design limitations
- Tail-Call Optimization (TCO) / Recursion instead of a explicit loop state
- Tail recursion
- tail recursion optimizations
- about / Tail recursion optimizations
- takewhile() function
- about / Using the finite iterators, Stateful filtering with dropwhile() and takewhile()
- stateful filtering with / Stateful filtering with dropwhile() and takewhile()
- tee() function
- about / Cloning iterators with tee()
- iterators, cloning with / Cloning iterators with tee()
- total_ordering decorator
- about / Defining classes with total ordering
- classes, defining with / Defining classes with total ordering
- true conditional expressions
- filtering / Filtering true conditional expressions
- tuples
- about / Using tuples and namedtuples
U
- update_wrapper() function
W
- @wraps decorator
- web services, defining as functions
- about / Defining web services as functions
- 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 CSV format / Serializing data into the JSON or CSV format
- data, serializing into JSON format / Serializing data into the JSON or CSV format
- data, serializing into XML / Serializing data into XML
- data, serializing into HTML / Serializing data into HTML
- wget / The HTTP request-response model
- Wrap-Unwrap design patterns
- wrapper() function
- wrapping
- parallelism / Wrapping instead of state changing
- serialism / Wrapping instead of state changing
- writerows() method / Serializing data into the JSON or CSV format
- WSGI
- about / The WSGI standard
- exceptions, throwing / Throwing exceptions during WSGI processing
- pragmatic WSGI applications / Pragmatic WSGI applications
- WSGI application
- creating / Creating the WSGI application
X
- XML serialization / Serializing data into XML
Z
- z() function
- zip() function
- using / Using zip() to structure and flatten sequences
- about / Using zip() to structure and flatten sequences, Using map() with multiple sequences
- zipped sequence, unzipping / Unzipping a zipped sequence
- used, for flattening sequences / Flattening sequences
- flat sequences, structuring / Structuring flat sequences
- alternate approach, for structuring flat sequences / Structuring flat sequences—an alternative approach
- zip_longest() function
- about / Using the finite iterators, Merging iterables with zip_longest() and zip()
- iterables, merging with / Merging iterables with zip_longest() and zip()