补SciPy 1.18.0手册四处。①完整签名gstd(a, axis=0, ddof=1, *, keepdims=False, nan_policy='propagate'),参数表原文输入须是「An array containing finite, strictly positive, real numbers」,axis收int、tuple或None(官方示例有axis=(1,2)按多轴算);返回值在axis为None或a是一维数组时是float否则ndarray。②Notes数学式s_G=exp(s)、s=sqrt(1/(n-d)·Σ(y_i-ȳ)²),其中y_i=log(x_i)、d即ddof;原文点名「The geometric standard deviation is sometimes confused with the exponential of the standard deviation, exp(std(a)). Instead, the geometric standard deviation is exp(std(log(a)))」——与帖中「先取对数再算标准差」完全同义。③无穷大的观测会让结果是NaN,原文「When an observation is infinite, the geometric standard deviation is NaN (undefined)」;非正数出NaN的原因原文给的是自然对数只对正实数有定义且有限,比「不能代入」更精确;默认ddof=1原文明确「different from the default value used by similar functions, such as numpy.std and numpy.var」。④官方示例可当回归对照:a=np.arange(1,25).reshape(2,3,4)时axis=None得2.2944076136018947、axis=2得2x3数组〔1.82424757, 1.22436866, 1.13183117 / 1.09348306, 1.07244798, 1.05914985〕、axis=(1,2)得〔2.12939215, 1.22120169〕。Array API实验特性SCIPY_ARRAY_API=1与hmean同一张支持表,MArrays掩码视为不存在。
广告由 Google AdSense 投放,标为广告,与帖子分开。请勿点击自己的广告,也不要请别人点。行情讨论不是荐股。本地服务帖写地点和价格,线下交易注意安全。