Python intermediate results use imap/ifilter instead of map/filter as far as possible
This article mainly introduces the python intermediate results as far as possible to use imap/ifilter instead of map/filter, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Try to use imap/ifilter instead of map/filter in the intermediate result.
# # reduce (rf, filter (ff, map (mf, a_list) # # recommended from itertools import ifilter, imapreduce (rf, ifilter (ff, imap (mf, a_list) * lazy evaluation will bring higher memory efficiency, especially when dealing with big data operation. Thank you for reading this article carefully. I hope the article "python Intermediate results use imap/ifilter instead of map/filter as much as possible" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!