作者介绍 SteveF.Lott,haeeprogramming since the '70s, whecomputers were large,expensive, and rare. He'eeusing Pythoto solve business problems for over 10 years.His other titles with Packt Publishing include PythoEssentials, Mastering Object-OrientedPython, Functional PythoProgramming, and Pythofor Secret Agents. Steveis currently atechnomad who lives icity along the east coast of the U.S. You cafollow his technologyblog (slott-softwarearchitect). 序言 Copyright and CreditsPrefaceChapter 1: Understanding Functional ProgrammingIdentifying a paradigmSubdividing the procedural paradigmUsing the functional paradigmUsing a functional hybridLooking at object creationThe stack of turtlesA classic example of functional programmingExploratory data analysisSummaryChapter 2: Introducing Essential Functional ConceptsFirst-class functionsPure functionsHigher-order functionsImmutable dataStrict and non-strict evaluationRecursioinstead of aexplicit loop stateFunctional type systemsFamiliar territoryLearning some advanced conceptsSummaryChapter 3: Functions, Iterators, and GeneratorsWriting pure functionsFunctions as first-class objectsUsing stringsUsing tuples and named tuplesUsing generator expressionsExploring the limitations of generatorsCombining generator expressionsCleaning raw data with generator functionsUsing lists, dicts, and setsUsing stateful mappingsUsing the bisect module to create a mappingUsing stateful setsSummaryChapter 4: Working with CollectionsAoverview of functiovarietiesWorking with iterablesParsing aXML fileParsing a file at a higher levelPairing up items from a sequenceUsing the iterO functioexplicitlyExtending a simple loopApplying generator expressions to scalar functionsUsing any() and all() as reductionsUsing lenO and sum()Using sums and counts for statisticsUsing zip() to structure and flattesequencesUnzipping a zipped sequenceFlattening sequencesStructuring flat sequencesStructuring flat sequences - aalternative approachUsing reversed() to change the orderUsing enumerate() to include a sequence numberSummaryChapter 5: Higher-Order FunctionsUsing max() and min0 to find extremaUsing Pytholambda formsLambdas and the lambda calculusUsing the map() functioto apply a functioto a collectionWorking with lambda forms and map()Using map() with multiple sequencesUsing the filter() functioto pass or reject dataUsing filter() to identify outliersThe iter0 functiowith a sentinel valueUsing sorted() to put data iorderWriting higher-order functionsWriting higher-order mappings and filtersUnwrapping data while mappingWrapping additional data while mappingFlattening data while mappingStructuring data while filteringWriting generator functionsBuilding higher-order functions with callablesAssuring good functional designReview of some desigpatternsSummaryChapter 6: Recursions and ReductionsSimple numerical recursionsImplementing tail-call optimizationLeaving recursioiplaceHandling difficult tail-call optimizationProcessing collections through recursionTail-call optimizatiofor collectionsReductions and folding a collectiofrom many items to oneGroup-by reductiofrom many items to fewerBuilding a mapping with CounterBuilding a mapping by sortingGrouping or partitioning data by key valuesWriting more general group-by reductionsWriting higher-order reductionsWriting file parsersParsing CSV filesParsing plaitext files with headersSummaryChapter 7: Additional Tuple TechniquesUsing tuples to collect dataUsing named tuples to collect dataBuilding named tuples with functional constructorsAvoiding stateful classes by using families of tuplesAssigning statistical ranksWrapping instead of state changingRewrapping instead of state changingComputing Spearmarank-order correlationPolymorphism and type-pattermatchingSummaryChapter 8: The Itertools ModuleWorking with the infinite iteratorsCounting with count()Counting with float argumentsRe-iterating a cycle with cycle()Repeating a single value with repeat()Using the finite iteratorsAssigning numbers with enumerate()Running totals with accumulate()Combining iterators with chain()Partitioning aiterator with groupby0Merging iterables with zip_longest0 and zip()Filtering with compress()Picking subsets with islice()Stateful filtering with dropwhile0 and takewhile0Two approaches to filtering with filterfalse() and filter()Applying a functioto data via starmap0 and map()Cloning iterators with tee()The itertools recipesSummaryChapter 9: More Itertools TechniquesEnumerating the CartesiaproductReducing a productComputing distancesGetting all pixels and all colorsPerformance analysisRearranging the problemCombining two transformationsPermuting a collectioof valuesGenerating all combinationsRecipesSummaryChapter 10: The Functools ModuleFunctiotoolsMemoizing previous results with Iru_cacheDefining classes with total orderingDefining number classesApplying partial arguments with partial()Reducing sets of data with the reduce() functionCombining map() and reduce()Using the reduce() and partial() functionsUsing the map() and reduce() functions to sanitize raw dataUsing the groupby0 and reduce() functionsSummaryChapter 11: Decorator DesigTechniquesDecorators as higher-order functionsUsing the functools update_wrapper0 functionsCross-cutting concernsComposite designPreprocessing bad dataAdding a parameter to a decoratorImplementing more complex decoratorsCompLex desigconsiderationsSummaryChapter 12: The Multiprocessing and Threading ModulesFunctional programming and concurrencyWhat concurrency really meansThe boundary conditionsSharing resources with process or threadsWhere benefits will accrueUsing multiprocessing pools and tasksProcessing many large filesParsing log files - gathering the rowsParsing log lines into namedtuplesParsing additional fields of aAccess objectFiltering the access detailsAnalyzing the access detailsThe complete analysis processUsing a multiprocessing pool for concurrent processingUsing apply() to make a single requestUsing the map_async0, starmap_async(), and apply_async0 functionsMore complex multiprocessing architecturesUsing the concurrent.futures moduleUsing concurrent.futures thread poolsUsing the threading and queue modulesDesigning concurrent processingSummaryChapter 13: Conditional Expressions and the Operator ModuleEvaluating conditional expressionsExploiting non-strict dictionary rulesFiltering true conditional expressionsFinding a matching patternUsing the operator module instead of lambdasGetting named attributes wheusing higher-order functionsStarmapping with operatorsReducing with operator module functionsSummaryChapter 14: The PyMonad LibraryDownloading and installingFunctional compositioand curryingUsing curried higher-order functionsCurrying the hard wayFunctional compositioand the PyMonad operatorFunctors and applicative functorsUsing the lazy List() functorMonad bind() functioand the >> operatorImplementing simulatiowith monadsAdditional PyMonad featuresSummaryChapter 15: A Functional Approach to Web ServicesThe HTTP request-response modelInjecting state through cookiesConsidering a server with a functional designLooking more deeply into the functional viewNesting the servicesThe WSGI standardThrowing exceptions during WSGI processingPragmatic WSGI applicationsDefining web services as functionsCreating the WSGI applicationGetting raw dataApplying a filterSerializing the resultsSerializing data into JSON or CSV formatsSerializing data into XMLSerializing data into HTMLTracking usageSummaryChapter 16: Optimizations and ImprovementsMemoizatioand cachingSpecializing memoizationTail recursiooptimizationsOptimizing storageOptimizing accuracyReducing accuracy based oaudience requirementsCase study-making a chi-squared decisionFiltering and reducing the raw data with a Counter objectReading summarized dataComputing sums with a Counter objectComputing probabilities from Counter objectsComputing expected values and displaying a contingency tableComputing the chi-squared valueComputing the chi-squared thresholdComputing the incomplete gamma functionComputing the complete gamma functionComputing the odds of a distributiobeing randomFunctional programming desigpatternsSummaryOther Books You May EnjoyIndex
以下为对购买帮助不大的评价