小编Auv*_*vee的帖子

运行 React Native 应用程序时无法识别的 VM 选项“MaxPermSize=512m”且无法创建 Java 虚拟机(已关闭)

我尝试使用此命令运行反应本机应用程序。

npx react-native run-android --variant=stagingDebug --appId com.xx_staging
Run Code Online (Sandbox Code Playgroud)

但我收到此错误消息。我想在我的机器上运行多个java版本。我怎样才能做到这一点?我也不想更改MaxPermSize=512m。我想保持MaxPermSize=512m不变。

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 2228 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
'"adb"' is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found …
Run Code Online (Sandbox Code Playgroud)

java java-7 java-8 java-11

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

如何将 datetime.timedelta 转换为 int?

我在 sklearn 随机森林分类器的帮助下编写了这些代码,用于在某些数据集上进行预测和测试准确性。

代码

a = datetime.datetime.now()
y_pred=clf.predict(X_test)
b = datetime.datetime.now()

rf_time = b-a

rf_ac = metrics.accuracy_score(y_test, y_pred)

print(type(rf_time))
print('Random Forest Time Duration - ',b-a)
print("Random Forest Accuracy:",metrics.accuracy_score(y_test, y_pred))
Run Code Online (Sandbox Code Playgroud)

输出

<class 'datetime.timedelta'>
Random Forest Time Duration -  0:00:00.011969
Random Forest Accuracy: 0.6324761904761905
Run Code Online (Sandbox Code Playgroud)

在这里我得到了rf_time哪种类型datetime.timedelta。现在,我怎样才能将其转换datetime.timedelta为整数。如何从 中获取 int 值0:00:00.011969

python datetime datetime-format python-3.x python-datetime

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