Code Sample

nonna = values_to_mask[-na_mask]

Problem description

In the core/common.py, there exists on line 359 the above code sample. As of now the error message is as displayed below:

TypeError: The numpy boolean negative, the - operator, is not supported, use the ~ operator or the logical_not function instead.

I thought this had been updated, but upon running conda update, I'm still receiving this error (I'm currently running 0.20.2 of pandas) and numpy 1.12.1 on python 2.7.

Comment From: TomAugspurger

Could you post the full traceback (including your input)? And double check your versions? Hard to say for sure, but I think you're referencing https://github.com/pandas-dev/pandas/blob/473615e4e0e7f01410a0a2cc8ded10af5d393957/pandas/core/missing.py#L40, which is correct

Comment From: tungalbert99

Weird. On Anaconda it states that its 0.20, but in the notebook it states that its 0.13. I'm assuming this was resolved between those versions. Thanks!

Comment From: TomAugspurger

Good to hear. It might be an issue with how the ipython kernels are installed. jupyter kernelspec list may point you in the right direction. Notebooks can also specify specific kernels to use, so import sys; print(sys.executable) should tell you for sure what python is being used.

Comment From: ge5738

Dear all, I am trying to do SOM analysis of protein throughout the simulation using ipython in jupyter-notebook by following the tutorial given on Github. when i run the command "clust = SOMclust.clusters(umat, bmus, som.smap)" i got the following error- TypeError Traceback (most recent call last) in () ----> 1 clust = SOMclust.clusters(umat, bmus, som.smap)

/home/ishrat/SOM/SOMclust.pyc in init(self, umatrix, bmus, smap, waterstop) 39 self.x_offset, self.y_offset, self.mask = (None, None, None) 40 self.umatrix = umatrix ---> 41 self.umat_cont, self.x_offset, self.y_offset, self.mask, self.waterlevels, self.flooding = self.flood(umatrix, verbose = True, waterstop=waterstop) 42 self.bmus = bmus 43 self.som = SOM2.SOM()

/home/ishrat/SOM/SOMclust.pyc in flood(self, inputmat, x_offset, y_offset, mask, verbose, waterstop, startingpoint, floodgate) 120 break 121 if not floodgate: --> 122 mask, x_offset, y_offset = arrange(circummat) 123 a = matexpand[x_offset] 124 out = a[:,y_offset]

/home/ishrat/SOM/SOMclust.pyc in arrange(outmatrix) 48 (x_offset, y_offset, mask) = (self.x_offset, self.y_offset, self.mask) 49 def arrange(outmatrix): ---> 50 x_offset = -(outmatrix==0).all(axis=1) 51 y_offset = -(outmatrix==0).all(axis=0) 52 mask = outmatrix == 0

TypeError: The numpy boolean negative, the - operator, is not supported, use the ~ operator or the logical_not function instead. please help in overcoming the above poblem. I have updated the anaconda also.

Comment From: TomAugspurger

@ge5738 this looks like a different issue (and unrelated to pandas). You might try asking the SOMclust developers. You should try to make a small reproducible example for them.

Comment From: ge5738

Thanks for telling me where to write my problem. Actually i am learner so i am trying to understand all this.