如何查看 Julia 包中的方法列表 [英] How can I see the list of methods in a Julia Package

查看:20
本文介绍了如何查看 Julia 包中的方法列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Julia 中有没有列出包中所有可用方法的命令?

Is there a command in Julia that lists all the methods that are available in a package?

例如我加载 Distributions

For example I load up Distributions

using Distributions

现在我想看看调用什么函数从正态分布中抽取随机值.有没有一个好方法可以在没有谷歌搜索的情况下从 Julia 内部做到这一点?

and now I would like to see what function to call to draw a random value from a normal distribution. Is there a good way to do this from inside of Julia without a google search?

推荐答案

有点,虽然我认为它没有多大用处:

Sort of, although I don't think its of much utility:

julia> using Distributions

julia> names(Distributions)
215-element Array{Symbol,1}:
 :median
 :logpdf
 :logpmf!
 :Chisq
 :posterior_rand
 :fit_mle!
 :NegativeBinomial
 :posterior_rand!
 :ContinuousMatrixDistribution
 :ValueSupport
 :InverseGamma
 :complete
 :TDist
 :NormalCanon
 :SufficientStats
 :Chi
 :logpmf
 :logdetcov
 :Gumbel
 :Sampleable
 ...

或以非编程方式,使用

julia> whos(Distributions)
AbstractMixtureModel          DataType
AbstractMvNormal              DataType
Arcsine                       DataType
Bernoulli                     DataType
Beta                          DataType
BetaPrime                     DataType
Binomial                      DataType

我认为,通过在 Julia 0.4 中包含内置文档系统,我们将获得更多包含 REPL 可用文档的软件包.

I think that with the inclusion of an inbuilt documentation system in Julia 0.4, we'll get way more packages with docs available at the REPL.

这篇关于如何查看 Julia 包中的方法列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆