策帕林0.8.2-SNAPSHOT。间歇性的网络套接字用齐柏林飞艇写EOF 1006。
我已经基于Python 3.7创建了一个带有一些库的docker容器。
这是我的Dockerfile:
FROM python:3.7
RUN apt-get update
RUN pip install --upgrade pip
RUN pip install numpy pandas scipy matplotlib
RUN apt-get install -y libaio-dev
RUN apt-get clean
构建图像:
docker build --build-arg http_proxy=http://host:port --build-arg https_proxy=http:// host:port -t custompy37 .
激活了我的docker容器:
%python.docker activate custompy37
我多次执行了笔记本,并在下面的日志文件中看到间歇性错误:
NotebookServer.java[onClose]:372) - Closed connection to xxx.xxx.xxx.xxx : 58950. (1006) WebSocket Write EOF
以下是我笔记本中一些段落的示例,所有这些段落均来自开源。它们都在显示图形。
%python
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
fig = plt.figure()
ax = fig.gca(projection='3d')
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm,
linewidth=0, antialiased=False)
ax.set_zlim(-1.01, 1.01)
ax.zaxis.set_major_locator(LinearLocator(10))
ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f'))
fig.colorbar(surf, shrink=0.5, aspect=5)
plt.show()
%python
import matplotlib.pyplot as plt
import numpy as np
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2*np.pi*t)
plt.plot(t, s)
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('About as simple as it gets, folks')
plt.grid(True)
plt.savefig("test.png")
plt.show()
%python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig = plt.figure()
def f(x, y):
return np.sin(x) + np.cos(y)
x = np.linspace(0, 2 * np.pi, 120)
y = np.linspace(0, 2 * np.pi, 100).reshape(-1, 1)
im = plt.imshow(f(x, y), animated=True)
def updatefig(*args):
global x, y
x += np.pi / 15.
y += np.pi / 20.
im.set_array(f(x, y))
return im,
ani = animation.FuncAnimation(fig, updatefig, interval=50, blit=True)
plt.show()