python - 如何在 R 中使用 Python 函数 neighbours(healpix_index, nside, order='ring')?
问题描述
我尝试使用 R“reticulate”包在 R 中使用 python 函数 neighbours(healpix_index, nside, order='ring'),但未能评估它的实例,例如,
neighbours(healpix_index=23404309, nside=2048, order='nested')
这应该给我以下答案:
#Output=array([23404308, 23404310, 23404311, 23404354, 23404352, 23404010, 23403967, 23403966])
我失败的一段代码如下:
library(reticulate)
use_python("c:/python/python39")
py_install("numpy")
py_install("astropy")
py_install("astropy_healpix", pip = TRUE)
numpy <- import("numpy")
astropy_healpix <- import("astropy_healpix")
import_main(convert = TRUE)
import_builtins(convert = TRUE)
astropy_healpix$neighbours(23404309,2048,order='ring')
我需要评估 R 中的 Python 邻居函数,非常感谢您对这个问题的帮助。
太感谢了。
解决方案
推荐阅读
- javascript - React array.splice 连续多次调用该方法
- python - Discord Python - 如何让 BOT 搜索消息?
- ios - Xcode GUI 与编程枚举中 UIPageViewController.transitionStyle 的不同选项
- react-native - react-native run-android "无法在设备上安装应用程序..."
- css - React 中的内部样式
- reactjs - 反应:状态不触发返回
- haskell - 绑定到 Haskell 中数据结构内的 monad
- amazon-web-services - 汇总 AWS CloudWatch Logs 数据
- excel - 在每天不同的特定时间将值复制到另一个单元格
- push-notification - Webpush 的工作流程是什么?