https://dbader.org/python-tricks ► Write better & cleaner code using Python's advanced features
In this Python tutorial you'll discover another basic of functional programming, namely how to use the "reduce()" function to transform data structures.
We'll take an example data set represented using an immutable data structure from the previous videos in this series, and then we'll create a "reduced" or "derived" output from that data using Python's built-in reduce function.
"reduce()" (or "functools.reduce()" on Python 3) is one of the functional programming primitives or building blocks available in Python and it's useful in a number of contexts.
Later in the video you'll also see how the reduce function lets you group your data set into arbitrary categories. You'll also learn about Python's "defaultdict" class defined in the collections module, as well as some useful helpers in the "itertools" module, like "itertools.groupby".
This video is part of a series of Python functional programming tutorials that I'm recording so stay tuned for the next instalment.
Be sure to check out these additional articles and Python tutorials if you want to dive deeper into functional programming:
Immutable Data Structures in Python: • Functional Programming in Python: Immutabl...
https://dbader.org/blog/python-lambda...
List comprehensions: https://dbader.org/blog/list-dict-set...
FREE COURSE – "5 Thoughts on Mastering Python" https://dbader.org/python-mastery
SUBSCRIBE TO THIS CHANNEL: https://dbader.org/youtube
* *
► Python Developer MUGS, T-SHIRTS & MORE: https://nerdlettering.com
► PythonistaCafe – A peer-to-peer learning community for Python developers: https://www.pythonistacafe.com
FREE Python Coding Tutorials & News:
» Python Tutorials: https://dbader.org
» Python News on Twitter: / @dbader_org
» Weekly Tips for Pythonistas: https://dbader.org/newsletter
» Subscribe to this channel: https://dbader.org/youtube
Nesta página do site você pode assistir ao vídeo on-line Functional Programming in Python: The "reduce()" Function duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Real Python 20 Setembro 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 30,644 vezes e gostou 683 espectadores. Boa visualização!