[Tutor] Fsolve and CSV help

Alan Gauld alan.gauld at yahoo.co.uk
Wed Oct 13 15:02:07 EDT 2021


On 13/10/2021 16:40, Matt Lester wrote:

> I am trying to use the fsolve function

This group is for python language and standard library issues
so the Scipy modules are a wee bit out of our scope. There
are some users who might be able to help though. but you might
like to try on the SciPy forums too because there will be a
lot more users there.

> 	• Where do i read in and update the CSV data? Inside or outside the function?

Probably outside. Otherwise you are reading and writing to the same file
every time you call the function. That will make it slow and probably
overwrite all of your data each time too. Imagine using it inside a
loop. You'd end up with only the last iteration of the loop stored in
the file all the earlier calls would be lost!

> 	• Where to place the fsolve? Again, inside or outside the function?

I'm assuming inside for this one. Yu want your function to set up the
data then call fsolve then present back the results filtered or
formatted in some way. I assume...

> 	• I am having some issues with the array sizes, I’m assuming 
> this has to do with the CSV data being larger than the array of the 
> function, but I’m not sure how to fix that.

This is the kind of thing that's probably better answered on the
Scipy forum(s)

> I am new to python, and coding in general, 

We can help with those areas, but not so much with svcipy
module specific type issues.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list