You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I received the error in subject and I looked for the reason in the source code.
I realized that my data, after the line below, in mca.py, has some of the values changed to "inf":
self.D_c = numpy.diag(1/numpy.sqrt(self.c))
then I inspect for the reason and I noticed that self.c had some 0.00000000 values.
So naturally, dividing 1/0 will give something wrong, although numpy didn't throw any error it didn't computed, but turned the value to "inf" and applied to self.D_c
So what I did was just alter the values that was 0 to some value next to 0( 0.00000000000001), and it did worked.
i'm sharing my code with you :
##my code
# if self.c in the line below has any 0.0 then
# self.D_c = numpy.diag(1/numpy.sqrt(self.c))
# will occur division by 0, which numpy is not throwing
# the code below intents to fix that error putting a number
# as close to 0 as founded by logs of numpy: decimal of 13 digits of 0
# necessary use of panda
low_number = 0.00000000000001
temp_dict = self.c.to_dict()
temp_dtype = self.c.dtype
for i in temp_dict:
if temp_dict[i] == 0:
temp_dict[i] = low_number
self.c = pandas.Series(temp_dict, dtype=temp_dtype)
##end
self.D_c = numpy.diag(1/numpy.sqrt(self.c))
The text was updated successfully, but these errors were encountered:
Hi,
I received the error in subject and I looked for the reason in the source code.
I realized that my data, after the line below, in mca.py, has some of the values changed to "inf":
self.D_c = numpy.diag(1/numpy.sqrt(self.c))
then I inspect for the reason and I noticed that self.c had some 0.00000000 values.
So naturally, dividing 1/0 will give something wrong, although numpy didn't throw any error it didn't computed, but turned the value to "inf" and applied to self.D_c
So what I did was just alter the values that was 0 to some value next to 0( 0.00000000000001), and it did worked.
i'm sharing my code with you :
The text was updated successfully, but these errors were encountered: