How to apply a function to every element in a list using Linq in C #, like reduce () method in python?
Assuming you say this reduction function , the equivalent in C # and LINQ is Enumerable.Aggregate .
Quick example:
var list = Enumerable.Range(5, 3); // [5, 6, 7] Console.WriteLine("Aggregation: {0}", list.Aggregate((a, b) => (a + b))); // Result is "Aggregation: 18"
Enumerable.Aggregate - . (, , ) == > list.Aggregate(, ). , "", Sum, Min, Max, Average .. Aggregate , .
Source: https://habr.com/ru/post/1767241/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1767236/when-will-the-jar-command-refuse-to-add-a-class-to-a-jar-file&usg=ALkJrhgwoqIRQOGCC0YnRpWL11w9CIdkRgBoxplot in R showing average (again) - rdrawing part of a bitmap on canvas Android - androidСоздайте "таблицу" с помощью- htmlAlgorithm Fastest Path - algorithmSocket.IO/Node.JS/Rails 3/IE - node.jsCode in a base class method that does not execute when using the "base" keyword - inheritanceSearch engine performance in C # regular expressions. Should I avoid them if I can? - c #Google Docs Doc Collector? - javascriptIs it possible to use Flash ExternalInterface in IE9 beta? - flashAll Articles