ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 01 Feb 2019 11:06:01 +0100Symbolic product in Sage?https://ask.sagemath.org/question/9047/symbolic-product-in-sage/Suppose I'd like to compute
prod(1/x^4, x, 1, oo)
How can this be done?
I found an old [thread](https://groups.google.com/forum/?fromgroups#!topic/sage-support/ZLfVooTBLvw), but with no answers.bk322Fri, 08 Jun 2012 14:13:32 +0200https://ask.sagemath.org/question/9047/Product of elements in a sethttps://ask.sagemath.org/question/45261/product-of-elements-in-a-set/I have a set of numbers, and I would like to find the product of them. Generally speaking, the set of the numbers could be quite large, and will be complex, so I don't want to have to manually multiply them all. The example I have below only has 3 integer elements though..
v=[1,2,3]
S=Set(v)
S
c=S.cardinality()
c
My original thinking was something along the lines of:
P = prod(s[i] for i in range(1,c))
P
But I'm not sure how to:
1) define s[i] appropriately or
2) if this will work
I assume at some point I need to define I'm working in a complex field, but again, I'm not sure where I would need to do that?LukeC93Fri, 01 Feb 2019 11:06:01 +0100https://ask.sagemath.org/question/45261/How do I multiply items within a CSVhttps://ask.sagemath.org/question/10243/how-do-i-multiply-items-within-a-csv/Hi, I am trying to import a CSV file then find the product of all of the numbers within the file. The code I have used so far is:
import csv
mylist = list(csv.reader(open(DATA+'mydata.csv','rb'),dialect='excel'))
from numpy import prod
prod(mylist)
However, this doesn't work, I receive the following error "TypeError: cannot perform reduce with flexible type".
I think this is because of the format of how the mylist is created. This list data comes out in this format:
[['1'],['2'],['3']]
How do I coerce it into the format (1,2,3)?
NickCFri, 14 Jun 2013 21:29:29 +0200https://ask.sagemath.org/question/10243/How to import prod()?https://ask.sagemath.org/question/8161/how-to-import-prod/Hi all:
I'm adding code to sage.categories.quotient_fields.py and need to call upon the prod() function. Apparently i need to import it. How do i do that? I can't find out where it's located in the Sage file system. araichevThu, 02 Feb 2012 21:58:12 +0100https://ask.sagemath.org/question/8161/