numpy linalg.LinAlgError thrown by polyfit

44 views
Skip to first unread message

Florian Obersteiner

unread,
Jun 12, 2020, 5:57:04 PM6/12/20
to spyder
Dear Spyder community,

I'm experiencing a strange error: I have a script, that at some point calls a function from a module. This function contains a call to np.polyfit. I'm doing some very simple fitting there, similar to

import numpy as np
parms = np.polyfit(np.arange(10), (np.arange(10)-1)*1.1, 1)

only that my arrays have typically ~30-80k elements.

Now the strange part: this works fine on my Notebook but throws "np.linalg.LinAlgError" on my PC if I run the main script in Spyder. If I run the main script from a command prompt it works fine on both systems, which got me the impression that this could be a Spyder issue. I also tried different versions of Python3 with the same result. My work-around at the moment is to catch the error in a try/except and do another call to polyfit in the except block. Upon second call it works fine!

- both systems Windows 10 (1909), Python 3.8.3 x64 (also tested Python 3.7.6 x64), Spyder 4.1.3

Any thoughts?

cheers
Florian

Mauricio Azálgara Bedoya

unread,
Jun 15, 2020, 8:32:08 PM6/15/20
to spyd...@googlegroups.com
Hi there,
I hope you can get more insights on your task by reviewing the Numpy Reference | Release 1.16.6 (p. 713) or browsing the website https://numpy.org/doc/stable/reference/generated/numpy.linalg.LinAlgError.html?highlight=linalg%20linalgerror#numpy.linalg.LinAlgError. If you cannot fix the problem, you can run an except-command if possible. Regards,

--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/34b704a9-89af-400e-a506-e46915c2fb48o%40googlegroups.com.


--

Atentamente,

Mauricio Azálgara Bedoya

Dirección: 120 Calle Lima | Int. A-1, Yanahuara

                   04017 Arequipa

                   PERU

Móvil: ++51 998 050 690

Teléfono: ++51 54 317 803

Cuenta Skype: mazalgarab

Reply all
Reply to author
Forward
0 new messages