【问题标题】:Variable not in variable explorer in Spyder变量不在 Spyder 的变量资源管理器中
【发布时间】:2018-01-14 15:10:20
【问题描述】:

python 新手和 Spyder 新手,但以下是我的代码:

#calculating the probability that a data point belongs to a normal distribution
dVal = stats.norm(mu[0], sigma[0])  
dVal.pdf(15)
#passing in array to prob density function to get prob density at every  point in data set
dVal.pdf(X[:,0])[0:50]

我从以下位置获得此代码: http://www.johnwittenauer.net/machine-learning-exercises-in-python-part-8/ 我理解的其余代码,这一点我正在慢慢理解,但我的问题是为什么 dVal 变量没有出现在 Spyder 的变量资源管理器中?这仅仅是由于我的代码中的逻辑不正确还是与变量的类型有关还是有其他原因?

【问题讨论】:

    标签: python variables spyder


    【解决方案1】:

    根据文档here dVal 是一个对象。

    根据我对 Spyder 的记忆,变量浏览器中只显示简单的内置变量。

    您可以尝试使用同一窗口中的“对象检查器”选项卡来深入了解对象。

    您也可以输入 help(dVal) 来查看文档。

    您也可以输入 dir(dVal) 来查看属性和方法列表。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-15
      • 2021-11-09
      • 2023-04-07
      • 1970-01-01
      • 2019-10-13
      • 2016-03-23
      • 2013-10-06
      • 2018-04-21
      相关资源
      最近更新 更多