舉報

會員
Functional Python Programming
ThisbookisforPythondeveloperswhowouldliketoperformFunctionalprogrammingwithPython.PythonProgrammingknowledgeisassumed.
最新章節
- Leave a review - let other readers know what you think
- Other Books You May Enjoy
- Summary
- Functional programming design patterns
- Computing the odds of a distribution being random
- Computing the complete gamma function
品牌:中圖公司
上架時間:2021-08-27 18:12:33
出版社:Packt Publishing
本書數字版權由中圖公司提供,并由其授權上海閱文信息技術有限公司制作發行
- Leave a review - let other readers know what you think 更新時間:2021-08-27 19:21:04
- Other Books You May Enjoy
- Summary
- Functional programming design patterns
- Computing the odds of a distribution being random
- Computing the complete gamma function
- Computing the incomplete gamma function
- Computing the chi-squared threshold
- Computing the chi-squared value
- Computing expected values and displaying a contingency table
- Computing probabilities from Counter objects
- Computing sums with a Counter object
- Reading summarized data
- Filtering and reducing the raw data with a Counter object
- Case study–making a chi-squared decision
- Reducing accuracy based on audience requirements
- Optimizing accuracy
- Optimizing storage
- Tail recursion optimizations
- Specializing memoization
- Memoization and caching
- Optimizations and Improvements
- Summary
- Tracking usage
- Serializing data into HTML
- Serializing data into XML
- Serializing data into JSON or CSV formats
- Serializing the results
- Applying a filter
- Getting raw data
- Creating the WSGI application
- Defining web services as functions
- Pragmatic WSGI applications
- Throwing exceptions during WSGI processing
- The WSGI standard
- Nesting the services
- Looking more deeply into the functional view
- Considering a server with a functional design
- Injecting state through cookies
- The HTTP request-response model
- A Functional Approach to Web Services
- Summary
- Additional PyMonad features
- Implementing simulation with monads
- Monad bind() function and the >> operator
- Using the lazy List() functor
- Functors and applicative functors
- Functional composition and the PyMonad * operator
- Currying the hard way
- Using curried higher-order functions
- Functional composition and currying
- Downloading and installing
- The PyMonad Library
- Summary
- Reducing with operator module functions
- Starmapping with operators
- Getting named attributes when using higher-order functions
- Using the operator module instead of lambdas
- Finding a matching pattern
- Filtering true conditional expressions
- Exploiting non-strict dictionary rules
- Evaluating conditional expressions
- Conditional Expressions and the Operator Module
- Summary
- Designing concurrent processing
- Using the threading and queue modules
- Using concurrent.futures thread pools
- Using the concurrent.futures module
- More complex multiprocessing architectures
- Using the map_async() starmap_async() and apply_async() functions
- Using apply() to make a single request
- Using a multiprocessing pool for concurrent processing
- The complete analysis process
- Analyzing the access details
- Filtering the access details
- Parsing additional fields of an Access object
- Parsing log lines into namedtuples
- Parsing log files – gathering the rows
- Processing many large files
- Using multiprocessing pools and tasks
- Where benefits will accrue
- Sharing resources with process or threads
- The boundary conditions
- What concurrency really means
- Functional programming and concurrency
- The Multiprocessing and Threading Modules
- Summary
- Complex design considerations
- Implementing more complex decorators
- Adding a parameter to a decorator
- Preprocessing bad data
- Composite design
- Cross-cutting concerns
- Using the functools update_wrapper() functions
- Decorators as higher-order functions
- Decorator Design Techniques
- Summary
- Using the groupby() and reduce() functions
- Using the map() and reduce() functions to sanitize raw data
- Using the reduce() and partial() functions
- Combining map() and reduce()
- Reducing sets of data with the reduce() function
- Applying partial arguments with partial()
- Defining number classes
- Defining classes with total ordering
- Memoizing previous results with lru_cache
- Function tools
- The Functools Module
- Summary
- Recipes
- Generating all combinations
- Permuting a collection of values
- Combining two transformations
- Rearranging the problem
- Performance analysis
- Getting all pixels and all colors
- Computing distances
- Reducing a product
- Enumerating the Cartesian product
- More Itertools Techniques
- Summary
- The itertools recipes
- Cloning iterators with tee()
- Applying a function to data via starmap() and map()
- Two approaches to filtering with filterfalse() and filter()
- Stateful filtering with dropwhile() and takewhile()
- Picking subsets with islice()
- Filtering with compress()
- Merging iterables with zip_longest() and zip()
- Partitioning an iterator with groupby()
- Combining iterators with chain()
- Running totals with accumulate()
- Assigning numbers with enumerate()
- Using the finite iterators
- Repeating a single value with repeat()
- Re-iterating a cycle with cycle()
- Counting with float arguments
- Counting with count()
- Working with the infinite iterators
- The Itertools Module
- Summary
- Polymorphism and type-pattern matching
- Computing Spearman rank-order correlation
- Rewrapping instead of state changing
- Wrapping instead of state changing
- Assigning statistical ranks
- Avoiding stateful classes by using families of tuples
- Building named tuples with functional constructors
- Using named tuples to collect data
- Using tuples to collect data
- Additional Tuple Techniques
- Summary
- Parsing plain text files with headers
- Parsing CSV files
- Writing file parsers
- Writing higher-order reductions
- Writing more general group-by reductions
- Grouping or partitioning data by key values
- Building a mapping by sorting
- Building a mapping with Counter
- Group-by reduction from many items to fewer
- Reductions and folding a collection from many items to one
- Tail-call optimization for collections
- Processing collections through recursion
- Handling difficult tail-call optimization
- Leaving recursion in place
- Implementing tail-call optimization
- Simple numerical recursions
- Recursions and Reductions
- Summary
- Review of some design patterns
- Assuring good functional design
- Building higher-order functions with callables
- Writing generator functions
- Structuring data while filtering
- Flattening data while mapping
- Wrapping additional data while mapping
- Unwrapping data while mapping
- Writing higher-order mappings and filters
- Writing higher-order functions
- Using sorted() to put data in order
- The iter() function with a sentinel value
- Using filter() to identify outliers
- Using the filter() function to pass or reject data
- Using map() with multiple sequences
- Working with lambda forms and map()
- Using the map() function to apply a function to a collection
- Lambdas and the lambda calculus
- Using Python lambda forms
- Using max() and min() to find extrema
- Higher-Order Functions
- Summary
- Using enumerate() to include a sequence number
- Using reversed() to change the order
- Structuring flat sequences – an alternative approach
- Structuring flat sequences
- Flattening sequences
- Unzipping a zipped sequence
- Using zip() to structure and flatten sequences
- Using sums and counts for statistics
- Using len() and sum()
- Using any() and all() as reductions
- Applying generator expressions to scalar functions
- Extending a simple loop
- Using the iter() function explicitly
- Pairing up items from a sequence
- Parsing a file at a higher level
- Parsing an XML file
- Working with iterables
- An overview of function varieties
- Working with Collections
- Summary
- Using stateful sets
- Using the bisect module to create a mapping
- Using stateful mappings
- Using lists dicts and sets
- Cleaning raw data with generator functions
- Combining generator expressions
- Exploring the limitations of generators
- Using generator expressions
- Using tuples and named tuples
- Using strings
- Functions as first-class objects
- Writing pure functions
- Functions Iterators and Generators
- Summary
- Learning some advanced concepts
- Familiar territory
- Functional type systems
- Recursion instead of an explicit loop state
- Strict and non-strict evaluation
- Immutable data
- Higher-order functions
- Pure functions
- First-class functions
- Introducing Essential Functional Concepts
- Summary
- Exploratory data analysis
- A classic example of functional programming
- The stack of turtles
- Looking at object creation
- Using a functional hybrid
- Using the functional paradigm
- Subdividing the procedural paradigm
- Identifying a paradigm
- Understanding Functional Programming
- Reviews
- Get in touch
- Conventions used
- Download the example code files
- To get the most out of this book
- What this book covers
- Who this book is for
- Preface
- Packt is searching for authors like you
- About the reviewer
- About the author
- Contributors
- PacktPub.com
- Why subscribe?
- Packt Upsell
- Functional Python Programming Second Edition
- Copyright and Credits
- Title Page
- 封面
- 封面
- Title Page
- Copyright and Credits
- Functional Python Programming Second Edition
- Packt Upsell
- Why subscribe?
- PacktPub.com
- Contributors
- About the author
- About the reviewer
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Conventions used
- Get in touch
- Reviews
- Understanding Functional Programming
- Identifying a paradigm
- Subdividing the procedural paradigm
- Using the functional paradigm
- Using a functional hybrid
- Looking at object creation
- The stack of turtles
- A classic example of functional programming
- Exploratory data analysis
- Summary
- Introducing Essential Functional Concepts
- First-class functions
- Pure functions
- Higher-order functions
- Immutable data
- Strict and non-strict evaluation
- Recursion instead of an explicit loop state
- Functional type systems
- Familiar territory
- Learning some advanced concepts
- Summary
- Functions Iterators and Generators
- Writing pure functions
- Functions as first-class objects
- Using strings
- Using tuples and named tuples
- Using generator expressions
- Exploring the limitations of generators
- Combining generator expressions
- Cleaning raw data with generator functions
- Using lists dicts and sets
- Using stateful mappings
- Using the bisect module to create a mapping
- Using stateful sets
- Summary
- Working with Collections
- An overview of function varieties
- Working with iterables
- Parsing an XML file
- Parsing a file at a higher level
- Pairing up items from a sequence
- Using the iter() function explicitly
- Extending a simple loop
- Applying generator expressions to scalar functions
- Using any() and all() as reductions
- Using len() and sum()
- Using sums and counts for statistics
- Using zip() to structure and flatten sequences
- Unzipping a zipped sequence
- Flattening sequences
- Structuring flat sequences
- Structuring flat sequences – an alternative approach
- Using reversed() to change the order
- Using enumerate() to include a sequence number
- Summary
- Higher-Order Functions
- Using max() and min() to find extrema
- Using Python lambda forms
- Lambdas and the lambda calculus
- Using the map() function to apply a function to a collection
- Working with lambda forms and map()
- Using map() with multiple sequences
- Using the filter() function to pass or reject data
- Using filter() to identify outliers
- The iter() function with a sentinel value
- Using sorted() to put data in order
- Writing higher-order functions
- Writing higher-order mappings and filters
- Unwrapping data while mapping
- Wrapping additional data while mapping
- Flattening data while mapping
- Structuring data while filtering
- Writing generator functions
- Building higher-order functions with callables
- Assuring good functional design
- Review of some design patterns
- Summary
- Recursions and Reductions
- Simple numerical recursions
- Implementing tail-call optimization
- Leaving recursion in place
- Handling difficult tail-call optimization
- Processing collections through recursion
- Tail-call optimization for collections
- Reductions and folding a collection from many items to one
- Group-by reduction from many items to fewer
- Building a mapping with Counter
- Building a mapping by sorting
- Grouping or partitioning data by key values
- Writing more general group-by reductions
- Writing higher-order reductions
- Writing file parsers
- Parsing CSV files
- Parsing plain text files with headers
- Summary
- Additional Tuple Techniques
- Using tuples to collect data
- Using named tuples to collect data
- Building named tuples with functional constructors
- Avoiding stateful classes by using families of tuples
- Assigning statistical ranks
- Wrapping instead of state changing
- Rewrapping instead of state changing
- Computing Spearman rank-order correlation
- Polymorphism and type-pattern matching
- Summary
- The Itertools Module
- Working with the infinite iterators
- Counting with count()
- Counting with float arguments
- Re-iterating a cycle with cycle()
- Repeating a single value with repeat()
- Using the finite iterators
- Assigning numbers with enumerate()
- Running totals with accumulate()
- Combining iterators with chain()
- Partitioning an iterator with groupby()
- Merging iterables with zip_longest() and zip()
- Filtering with compress()
- Picking subsets with islice()
- Stateful filtering with dropwhile() and takewhile()
- Two approaches to filtering with filterfalse() and filter()
- Applying a function to data via starmap() and map()
- Cloning iterators with tee()
- The itertools recipes
- Summary
- More Itertools Techniques
- Enumerating the Cartesian product
- Reducing a product
- Computing distances
- Getting all pixels and all colors
- Performance analysis
- Rearranging the problem
- Combining two transformations
- Permuting a collection of values
- Generating all combinations
- Recipes
- Summary
- The Functools Module
- Function tools
- Memoizing previous results with lru_cache
- Defining classes with total ordering
- Defining number classes
- Applying partial arguments with partial()
- Reducing sets of data with the reduce() function
- Combining map() and reduce()
- Using the reduce() and partial() functions
- Using the map() and reduce() functions to sanitize raw data
- Using the groupby() and reduce() functions
- Summary
- Decorator Design Techniques
- Decorators as higher-order functions
- Using the functools update_wrapper() functions
- Cross-cutting concerns
- Composite design
- Preprocessing bad data
- Adding a parameter to a decorator
- Implementing more complex decorators
- Complex design considerations
- Summary
- The Multiprocessing and Threading Modules
- Functional programming and concurrency
- What concurrency really means
- The boundary conditions
- Sharing resources with process or threads
- Where benefits will accrue
- Using multiprocessing pools and tasks
- Processing many large files
- Parsing log files – gathering the rows
- Parsing log lines into namedtuples
- Parsing additional fields of an Access object
- Filtering the access details
- Analyzing the access details
- The complete analysis process
- Using a multiprocessing pool for concurrent processing
- Using apply() to make a single request
- Using the map_async() starmap_async() and apply_async() functions
- More complex multiprocessing architectures
- Using the concurrent.futures module
- Using concurrent.futures thread pools
- Using the threading and queue modules
- Designing concurrent processing
- Summary
- Conditional Expressions and the Operator Module
- Evaluating conditional expressions
- Exploiting non-strict dictionary rules
- Filtering true conditional expressions
- Finding a matching pattern
- Using the operator module instead of lambdas
- Getting named attributes when using higher-order functions
- Starmapping with operators
- Reducing with operator module functions
- Summary
- The PyMonad Library
- Downloading and installing
- Functional composition and currying
- Using curried higher-order functions
- Currying the hard way
- Functional composition and the PyMonad * operator
- Functors and applicative functors
- Using the lazy List() functor
- Monad bind() function and the >> operator
- Implementing simulation with monads
- Additional PyMonad features
- Summary
- A Functional Approach to Web Services
- The HTTP request-response model
- Injecting state through cookies
- Considering a server with a functional design
- Looking more deeply into the functional view
- Nesting the services
- The WSGI standard
- Throwing exceptions during WSGI processing
- Pragmatic WSGI applications
- Defining web services as functions
- Creating the WSGI application
- Getting raw data
- Applying a filter
- Serializing the results
- Serializing data into JSON or CSV formats
- Serializing data into XML
- Serializing data into HTML
- Tracking usage
- Summary
- Optimizations and Improvements
- Memoization and caching
- Specializing memoization
- Tail recursion optimizations
- Optimizing storage
- Optimizing accuracy
- Reducing accuracy based on audience requirements
- Case study–making a chi-squared decision
- Filtering and reducing the raw data with a Counter object
- Reading summarized data
- Computing sums with a Counter object
- Computing probabilities from Counter objects
- Computing expected values and displaying a contingency table
- Computing the chi-squared value
- Computing the chi-squared threshold
- Computing the incomplete gamma function
- Computing the complete gamma function
- Computing the odds of a distribution being random
- Functional programming design patterns
- Summary
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-08-27 19:21:04