Functional Python Programming

(Wang) #1

F


faster() function 40
file parsers, reductions
CSV files, parsing 137 , 138
plain text files, parsing with
headers 138 - 140
writing 135 - 137
fillvalue parameter 258
filterfalse() function
about 165 , 175
filtering with 175
filter() function
about 96
filtering with 175
used, for identifying outliers 98 , 99
used, for passing data 96 - 98
used, for rejecting data 96 - 98
using 256
finite iterators
accumulate() 165
accumulate(), used for running
totals 167 , 168
chain() 165
chain(), used for combining iterators 169
compress() 165
compress(), filtering with 171 , 172
dropwhile() 165
dropwhile(), stateful filtering with 173 , 174
enumerate() 165
enumerate(), used for assigning
numbers 166 , 167
filterfalse() 165
filterfalse(), filtering with 175
filter(), filtering with 175
groupby() 165
groupby(), used for partitioning
iterator 170 , 171
islice() 165
islice(), subsets picking with 172 , 173
starmap() 165
starmap(), used for applying function to
data 176 , 177
takewhile() 165


takewhile(), stateful filtering with 173 , 174
tee(), iterators cloning with 177
using 165
zip_longest() 165
zip_longest(), used for merging
iterables 171
first-class functions 24
first-class objects 39 , 40
First Normal Form 136
flatten function 179
float_lat_lon() function 136
Fortran code 18
functional composition
about 264
example 265
PyMonad multiplication operator,
using 268 , 269
functional features
about 23
advanced concepts 34
familiar territory 34
first-class functions 24
functional type systems 33
higher-order functions 25 , 26
immutable data 26 , 27
non-strict evaluation 27 - 29
pure functions 24 , 25
recursion 29 - 33
strict evaluation 27 - 29
functional hybrid
using 14 , 15
functional paradigm
using 12 - 14
functional programming
about 9
classic example 17 - 20
functional type systems 33
functions, as first-class objects 39 - 41
function tools 198
functools.reduce() function 260 , 266
functools.wraps() function 215
functor
about 270
applicative functors 270 , 271
Free download pdf