Functional Python Programming
...
Optimizations and Improvements In this chapter, we'll look at a few optimizations that we can make to create high performance fu ...
Optimizations and Improvements In Chapter 6, Recursions and Reductions, we looked at a few common kinds of recursions. The simpl ...
Chapter 16 Raw data that includes measurements often use floating point values. Since an exact equality comparison between float ...
Optimizations and Improvements Here's a Callable object with two caches that uses this prod() function: from collections.abc imp ...
Chapter 16 Design the recursion. This means the base case and the recursive cases. For example, this is a definition of computi ...
Optimizations and Improvements """ if n == 0: return 1 else: return n*fact(n-1) We added two edge cases: the explicit base case ...
Chapter 16 Optimizing storage There's no general rule for optimization. We often focus on optimizing performance because we have ...
Optimizations and Improvements In many cases, we can make small changes to a Python application to switch from float values to F ...
Chapter 16 This is a chi-squared decision on whether or not data is distributed randomly. In order to make this decision, we'll ...
Optimizations and Improvements The output will show all of the 12 combinations of shift and defect type. In the next section, we ...
Chapter 16 We created a types.SimpleNamespace parameter for each row. In the preceding example, the supplied column names are va ...
Optimizations and Improvements Once we've read the data, the next step is to develop two probabilities so that we can properly c ...
Chapter 16 We can assign this single source to the variable defects. The value looks like this: Counter({('3', 'C'): 49, ('1', ' ...
Optimizations and Improvements We can't use the default initial value of 0 for the sum() function. We must provide an empty Coun ...
Chapter 16 We've created two dictionaries: P_shift and P_type. The P_shift dictionary maps a shift to a Fraction object that sho ...
Optimizations and Improvements We'll create a dictionary that parallels the initial defects Counter object. This dictionary will ...
Chapter 16 Here's a sequence of statements to create the contingency table shown previously: print("obs exp"*len(type_totals)) f ...
Optimizations and Improvements The cumulative distribution function for X^2 shows that a value of 19.18 has a probability of the ...
Chapter 16 Both of these functions will require a factorial calculation, n!. We've seen several variations on the fractions them ...
«
10
11
12
13
14
15
16
17
18
19
»
Free download pdf