我尝试使用 mayavi 创建 3d 图,但是在运行我的 python 脚本时出现以下错误:
Traceback (most recent call last):
File "test.py", line 1, in <module>
import mayavi.mlab
File "C:\Python37\lib\site-packages\mayavi\mlab.py", line 15, in <module>
from mayavi.core.common import process_ui_events
File "C:\Python37\lib\site-packages\mayavi\core\common.py", line 16, in <module>
from apptools.persistence.state_pickler import create_instance
File "C:\Python37\lib\site-packages\apptools\persistence\state_pickler.py", line 1210
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
我正在尝试测试的功能:
def create_3D(dataset):
#Extract the x, y ,z and von mises data from the numpy dataset and create an array for each.
xs = dataset[:,1]
ys = dataset[:,2]
zs = dataset[:,3]
v …Run Code Online (Sandbox Code Playgroud) 所以我需要编写一个方法,它允许我找到下一个数字而不使用除String和StringBuffer类之外的任何东西(所以没有解析或任何东西).
当我运行我的代码时,除了最后一个输入(String k)之外,一切似乎都能正常工作.它会导致while循环中的outofbounds错误.但我不明白它是如何做到的,因为我的布尔值应该是假的(我认为因为它只包含九个)它不应该首先进入te循环.
public class Palindroom {
public static void main(String[] args) {
// TODO Auto-generated method stub
String s="347"
+ ""; System.out.println("s "+increment(s));
String p="199919";System.out.println(" p "+increment(p));
String d="199999";System.out.println( " d "+increment(d));
String k ="999999";System.out.println(" k "+increment(k));
}
static String increment (String s) {
StringBuffer sb = new StringBuffer (s);
char laatst = sb.charAt(sb.length()-1);
int laatste = sb.length()-1;
if(laatst == '9') {
int a = 1;
boolean nine = false;
for (int i = 0; i < sb.length(); i++) …Run Code Online (Sandbox Code Playgroud)