► 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:
* List comprehensions:
FREE COURSE – “5 Thoughts on Mastering Python”
SUBSCRIBE TO THIS CHANNEL:
* * *
► Python Developer MUGS, T-SHIRTS & MORE:
► PythonistaCafe – A peer-to-peer learning community for Python developers:
FREE Python Coding Tutorials & News:
» Python Tutorials:
» Python News on Twitter:
» Weekly Tips for Pythonistas:
» Subscribe to this channel:
Xem thêm bài viết khác: https://shaarique.com/cong-nghe/
Xem thêm Bài Viết:
- Smart tivi Sony 4K KD-55X9300E – Thông minh đến không ngờ | Điện máy XANH
- Mở hộp TV Samsung 65 inch 65NU7400 – UNBOXING TV Samsung NU7400 65 INCH
- [Hieuhien.vn] Cách học lệnh remote Android Tv Box với remote Tivi
- How to Use your Mobile Phone as a Samsung TV Remote
- MYFREEVIEW : Remote dekoder MYTV rosak? Remote mytv percuma dan mytv advance sama tak?