我最近从numpy 1.11升级到numpy 1.13,希望摆脱这个蒙面数组警告,但它仍然存在:
MaskedArrayFutureWarning: setting an item on a masked array which has a shared mask will not copy the mask and also change the original mask array in the future.
Check the NumPy 1.11 release notes for more information.*
基本上我的代码只是改变了一个掩码数组中的一些值,我不确定这个错误甚至意味着什么.
我希望升级到numpy 1.13可以解决这个问题,但我认为错误就在我的最后.
为清楚起见,尽管警告引用1.11,我仍在运行numpy 1.13:
Python 2.7.12(默认,2016年11月19日,06:48:10)
linux2上的[GCC 5.4.0 20160609]
输入"帮助","版权","信用"或"许可"以获取更多信息.
导入numpy为np
NP.版
'1.13.0.dev0 +未知'
谢谢你的帮助.猫
我有一个烦人的问题,过去几个月来我一直无法解决。基本上,我正在使用jupyter / ipython笔记本来调用pyqt并显示3d几何数据。这是我将应用程序初始化为对象的方式,在添加了一些多边形和点之后,我调用show():
class Figure(object):
'''
Main API functions
'''
def __init__(self):
print "... initializing canvas ..."
self.app = QApplication(sys.argv)
self.app.processEvents()
...
def show(self): #Show
self.GUI = GLWindow(data)
self.app.exec_()
Run Code Online (Sandbox Code Playgroud)
我想通过笔记本单元不断地交互/更新小部件。但是一旦我在jupyter笔记本中调用show()命令,由于笔记本的输出排队(?)并被锁定,我将无法再运行任何单元格或更新小部件:
#Initialize figure object inside the notebook
fig = plb.figure()
...
fig.show() #Locks out any further jupyter commands while widget on screen
fig.update() #Does not get executed until widget is closed
Run Code Online (Sandbox Code Playgroud)
通过笔记本调用的.show()函数似乎放弃了对python内核(?)的控制,但尚不清楚如何将其取回,以及如何将其连接到所显示的小部件。
鼠标和键盘事件确实与小部件交互,但是它们使用小部件代码内部的内在函数,例如mouseMoveEvent():
class GLWindow(QtGui.QWidget):
def __init__(self, fig, parent=None):
QtGui.QWidget.__init__(self, parent)
self.glWidget = GLWidget(fig, parent=self)
...
class GLWidget(QtOpenGL.QGLWidget):
def __init__(self, fig, …Run Code Online (Sandbox Code Playgroud)