1 min readAug 4, 2020
Dan, thanks for the comment!
You make a good point. If a count by some filter is the ultimate goal, I think you could get the count with something like:
len(df[df.LoanRange == 'a $5-10 million'])
# Output >>>: 4840
The above solution would be much better than iteration since have Pandas available.
However, in this story, I use iteration as an example to show how to construct and use a lambda function. We obviously don't either here, but I found it easier get a grasp on lambdas by thinking about iteration first.