Python Forum
Getting an unexpected generator object ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting an unexpected generator object ?
#10
In fact c is the return of the integrate.quad() from scipy.integrate.quad.
And it returns a Tuple:

>>> c= integrate.quad(f,0,1)
>>> print(c)
(0.33333333333333337, 3.700743415417189e-15)
So you need to get the first element of this tuple (index=0) to get only the integral of function f.

BTW I'm just checking the code...not the math!
Reply


Messages In This Thread
RE: Getting an unexpected generator object ? - by gontajones - Mar-27-2019, 01:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating list of lists from generator object t4keheart 1 2,227 Nov-13-2020, 04:59 AM
Last Post: perfringo
  unexpected object? urufu 2 2,041 Mar-08-2020, 02:35 PM
Last Post: urufu
  receive from a generator, send to a generator Skaperen 9 5,554 Feb-05-2018, 06:26 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020