函数式Python编程(第2版影印版英文版)

函数式Python编程(第2版影印版英文版)
分享
扫描下方二维码分享到微信
打开微信,点击右上角”+“,
使用”扫一扫“即可将网页分享到朋友圈。
作者: ,
2019-05
版次: 1
ISBN: 9787564183257
定价: 99.00
装帧: 平装
开本: 16开
纸张: 胶版纸
页数: 391页
1人买过
  •   如果你是一名想要了解如何利用函数式编程的强大功能并将其应用于自己的程序中的Python开发人员,那么《函数式Python编程(第2版 影印版 英文版)》是一本你不容错过的书,哪怕你对这种编程范式几乎一无所知。
      《函数式Python编程(第2版 影印版 英文版)》一开始先概述了函数式概念,你会了解到一些常见的函数式特性,例如头等函数、高阶函数、纯函数等。接下来,你将看到如何在Python中运用这些特性,以此为你提供立足的核心基础知识。在这之后,你将学习用于Python的常见函数式优化,以帮助你的应用程序达到更高的运行速度。
      你会学习到函数式编程的概念,例如使用Python的生成器函数和表达式实现惰性求值,然后学习如何设计和实现装饰器来创建复合函数。此外你还将深入探索数据预备技术和数据探查,了解Python标准库如何适应函数式编程模型。最后,为了结束Python函数式编程世界的探索旅程,《函数式Python编程(第2版 影印版 英文版)》会向你展示PyMonad项目和一些更大规模的示例,以开阔你的视野。   Steven F.Lott,has been programming since the '70s, when computers were large,expensive, and rare. He's been using Python to solve business problems for over 10 years.His other titles with Packt Publishing include Python Essentials, Mastering Object-OrientedPython, Functional Python Programming, and Python for Secret Agents. Steven is currently atechnomad who lives in city along the east coast of the U.S. You can follow his technologyblog (slott-softwarearchitect). Copyright and Credits
    Preface

    Chapter 1: 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

    Chapter 2: 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

    Chapter 3: 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

    Chapter 4: 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 iterO function explicitly
    Extending a simple loop
    Applying generator expressions to scalar functions
    Using any() and all() as reductions
    Using lenO 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

    Chapter 5: Higher-Order Functions
    Using max() and min0 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 iter0 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

    Chapter 6: 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

    Chapter 7: 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

    Chapter 8: 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 groupby0
    Merging iterables with zip_longest0 and zip()
    Filtering with compress()
    Picking subsets with islice()
    Stateful filtering with dropwhile0 and takewhile0
    Two approaches to filtering with filterfalse() and filter()
    Applying a function to data via starmap0 and map()
    Cloning iterators with tee()
    The itertools recipes
    Summary

    Chapter 9: 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

    Chapter 10: The Functools Module
    Function tools
    Memoizing previous results with Iru_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 groupby0 and reduce() functions
    Summary

    Chapter 11: Decorator Design Techniques
    Decorators as higher-order functions
    Using the functools update_wrapper0 functions
    Cross-cutting concerns
    Composite design
    Preprocessing bad data
    Adding a parameter to a decorator
    Implementing more complex decorators
    CompLex design considerations
    Summary

    Chapter 12: 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_async0, starmap_async(), and apply_async0 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

    Chapter 13: 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

    Chapter 14: 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

    Chapter 15: 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

    Chapter 16: 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
    Index
  • 内容简介:
      如果你是一名想要了解如何利用函数式编程的强大功能并将其应用于自己的程序中的Python开发人员,那么《函数式Python编程(第2版 影印版 英文版)》是一本你不容错过的书,哪怕你对这种编程范式几乎一无所知。
      《函数式Python编程(第2版 影印版 英文版)》一开始先概述了函数式概念,你会了解到一些常见的函数式特性,例如头等函数、高阶函数、纯函数等。接下来,你将看到如何在Python中运用这些特性,以此为你提供立足的核心基础知识。在这之后,你将学习用于Python的常见函数式优化,以帮助你的应用程序达到更高的运行速度。
      你会学习到函数式编程的概念,例如使用Python的生成器函数和表达式实现惰性求值,然后学习如何设计和实现装饰器来创建复合函数。此外你还将深入探索数据预备技术和数据探查,了解Python标准库如何适应函数式编程模型。最后,为了结束Python函数式编程世界的探索旅程,《函数式Python编程(第2版 影印版 英文版)》会向你展示PyMonad项目和一些更大规模的示例,以开阔你的视野。
  • 作者简介:
      Steven F.Lott,has been programming since the '70s, when computers were large,expensive, and rare. He's been using Python to solve business problems for over 10 years.His other titles with Packt Publishing include Python Essentials, Mastering Object-OrientedPython, Functional Python Programming, and Python for Secret Agents. Steven is currently atechnomad who lives in city along the east coast of the U.S. You can follow his technologyblog (slott-softwarearchitect).
  • 目录:
    Copyright and Credits
    Preface

    Chapter 1: 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

    Chapter 2: 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

    Chapter 3: 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

    Chapter 4: 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 iterO function explicitly
    Extending a simple loop
    Applying generator expressions to scalar functions
    Using any() and all() as reductions
    Using lenO 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

    Chapter 5: Higher-Order Functions
    Using max() and min0 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 iter0 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

    Chapter 6: 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

    Chapter 7: 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

    Chapter 8: 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 groupby0
    Merging iterables with zip_longest0 and zip()
    Filtering with compress()
    Picking subsets with islice()
    Stateful filtering with dropwhile0 and takewhile0
    Two approaches to filtering with filterfalse() and filter()
    Applying a function to data via starmap0 and map()
    Cloning iterators with tee()
    The itertools recipes
    Summary

    Chapter 9: 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

    Chapter 10: The Functools Module
    Function tools
    Memoizing previous results with Iru_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 groupby0 and reduce() functions
    Summary

    Chapter 11: Decorator Design Techniques
    Decorators as higher-order functions
    Using the functools update_wrapper0 functions
    Cross-cutting concerns
    Composite design
    Preprocessing bad data
    Adding a parameter to a decorator
    Implementing more complex decorators
    CompLex design considerations
    Summary

    Chapter 12: 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_async0, starmap_async(), and apply_async0 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

    Chapter 13: 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

    Chapter 14: 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

    Chapter 15: 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

    Chapter 16: 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
    Index
查看详情
12
相关图书 / 更多
函数式Python编程(第2版影印版英文版)
函数策略加密体制研究
张明武
函数式Python编程(第2版影印版英文版)
函数逼近论及其应用(许兰喜)
许兰喜 编
函数式Python编程(第2版影印版英文版)
函数式编程入门:使用Elixir
乌利斯·阿尔梅达 著
函数式Python编程(第2版影印版英文版)
函数式程序设计
邓玉欣
函数式Python编程(第2版影印版英文版)
函数(全国通用)/新高考数学你真的掌握了吗
张杨文、兰师勇 编
函数式Python编程(第2版影印版英文版)
函数和图像(盖尔范德中学生数学思维丛书)
[美]伊斯雷尔·盖尔范德;[乌克兰]伊莲娜·格拉戈勒娃;[俄罗斯]埃马努伊尔·薛诺
函数式Python编程(第2版影印版英文版)
函数(i练习全国通用)/新高考数学你真的掌握了吗
张杨文、兰师勇 编
函数式Python编程(第2版影印版英文版)
函数逼近理论与方法研究
王慧 著
函数式Python编程(第2版影印版英文版)
函数方程热点问题集
[美]蒂图.安德雷斯库 著;程晓亮 译
函数式Python编程(第2版影印版英文版)
函数型回归模型的统计推断及其应用
唐庆国 著
函数式Python编程(第2版影印版英文版)
函数程序设计算法
[美]约翰·大卫·斯通(John David Stone)
函数式Python编程(第2版影印版英文版)
函数777题问答
马传渔;陈荣华
您可能感兴趣 / 更多
函数式Python编程(第2版影印版英文版)
卡尺校验的运动学对线全膝关节置换术——原理、手术技术与应用前景
Stephen;M.Howell
函数式Python编程(第2版影印版英文版)
量子信息 香农信息科学经典
Stephen Barnett 著
函数式Python编程(第2版影印版英文版)
AO足踝骨折治疗原则
Stefan Rammelt Michael Swords Mandeep S Dhillon Andrew K Sands
函数式Python编程(第2版影印版英文版)
互联网与民主
Stephen Coleman
函数式Python编程(第2版影印版英文版)
现代钻井技术/国外油气勘探开发新进展丛书
Stefan 著;[挪]Bernt、S.Aadnoy、[美]Iain、Cooper、张明、窦亮彬、曹杰、张益、李响 译
函数式Python编程(第2版影印版英文版)
花园不是一天建成的
Stewart 著;吴湛 译;[美]艾米·斯图尔特(Amy
函数式Python编程(第2版影印版英文版)
你好!德语(视频版)(A1)(练习手册)
Stefanie Dengler
函数式Python编程(第2版影印版英文版)
你好!德语(视频版)(A1)(学生用书)
Stefanie Dengler
函数式Python编程(第2版影印版英文版)
复变量导引(影印版)
Steven G. Krantz
函数式Python编程(第2版影印版英文版)
泛函分析导引(影印版)
Steven G. Krantz
函数式Python编程(第2版影印版英文版)
调和分析概览(影印版)
Steven G. Krantz
函数式Python编程(第2版影印版英文版)
国际关系(第三版)
Stephanie Lawson