Top "Sum" questions

The 'sum' function which returns the sum of the items in an array.

Linq query with nullable sum

from i in Db.Items select new VotedItem { ItemId = i.ItemId, Points = (from v in Db.Votes where b.ItemId == …

c# linq linq-to-sql sum nullable
Sum of row n through last row

I want to create a TOTAL row at the top of my spreadsheet. In this row, each cell should be …

google-sheets sum google-sheets-formula
Sum of list of lists; returns sum list

Let data = [[3,7,2],[1,4,5],[9,8,7]] Let's say I want to sum the elements for the indices of each list in the list, like …

python list matrix sum
Counting positive integer elements in a list with Python list comprehensions

I have a list of integers and I need to count how many of them are > 0. I'm currently doing …

python list sum integer list-comprehension
Python: next() function

I'm learning Python from a book, and I came across this example: M = [[1,2,3], [4,5,6], [7,8,9]] G = (sum(row) for row in M) # …

python sum next
How to sum dict elements

In Python, I have list of dicts: dict1 = [{'a':2, 'b':3},{'a':3, 'b':4}] I want one final dict that will contain …

python dictionary sum
Finding the sum of even valued terms in Fibonacci sequence

#!/usr/bin/python2 """ Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting …

python sum fibonacci
Calculate total sum of all numbers in c:forEach loop

I have a Java bean like this: class Person { int age; String name; } I'd like to iterate over a collection …

jsp foreach sum jstl totals
Using SUM() without grouping the results

I already read (this), but couldn't figure out a way to implement it to my specific problem. I know SUM() …

mysql sum
How to select sum -or- 0 if no records exist?

I need to write a query that returns the sum of all values that meet a certain criteria, but the …

mysql sum