小编cer*_*v21的帖子

python中的3D样条插值

我正在搜索等效的 Matlab 命令

Vq = interp3(X,Y,Z,V,Xq,Yq,Zq)

在 Python 中。在 Matlab 中,我可以使用“样条”插值方法,而在 Python 中找不到 3D 数据。存在 scipy.interpolate.griddata,但它没有 3D 数据的样条选项。

我想要插值的数据是一个 3D 矩阵 (51x51x51),它有规律地分布在 3D 网格上。

scipy.interpolate.Rbf 可能是选项,但我没有得到它的工作:

xi = yi = zi = np.linspace(1, 132651, 132651) interp = scipy.interpolate.Rbf(xi, yi, zi, data, function='cubic')

导致内存错误。

编辑:我想要的最小示例(无插值):Matlab 代码

v=rand([51,51,51]);
isosurface (v, 0.3);
Run Code Online (Sandbox Code Playgroud)

为简单起见,我在本例中使用随机数据。我想制作等值面图(特别是费米面图)。由于某些结构非常小,因此需要 51x51x51 的高网格分辨率。

进一步评论:矩阵中的数据集彼此独立,z(或第三个分量)不是 x 和 y 的函数。

python interpolation cubic-spline

7
推荐指数
1
解决办法
2万
查看次数

Jupyterlab 扩展给出函数未找到错误

我在 ArchLinux 上遇到了 jupyter 扩展的问题。特别是,我收到以下错误:

[W 2023-04-01 18:34:36.504 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_nbextensions_configurator. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[W 2023-04-01 18:34:36.493 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
Run Code Online (Sandbox Code Playgroud)

我怎样才能摆脱这个错误/警告?我尝试用 Pip 删除这些功能,但没有成功。有任何想法吗?

python jupyter-notebook jupyter-lab

3
推荐指数
1
解决办法
7304
查看次数

Matlab:将总和放入函数中

我想通过函数来​​近似数值数据:

f = @(a0,xdata) a0(1).*xdata + ... + a0(n) .* xdata.^n
Run Code Online (Sandbox Code Playgroud)

我该怎么做,因为 for 循环在函数中不起作用?我知道有一个内部多项式函数,但由于我可能想将总和扩展到非整数指数,我想编写自己的函数。

matlab function octave

2
推荐指数
1
解决办法
69
查看次数