如何在python中计算累积分布函数(CDF)?
我想从我所拥有的点数(离散分布)计算它,而不是像scipy那样的连续分布.
我仍在尝试掌握 Flow 的工作原理,谁能解释一下为什么这个简单的示例会引发错误?
function say(text: string) {
console.log(text);
}
say('Hello World!'); // This is alright
const text: ?string = 'Hello World!';
say(text); // Error:(219, 5) Cannot call `say` with `text` bound to `text` because null or undefined [1] is incompatible with string [2].
Run Code Online (Sandbox Code Playgroud)
我知道,文本变量可以为空,但是当我调用 say(text) 时,它显然不是空的。