小编use*_*186的帖子

OverflowError:long int太大,无法在python中转换为float

我试图在python中计算泊松分布如下:

p = math.pow(3,idx)
depart = math.exp(-3) * p 
depart = depart / math.factorial(idx)
Run Code Online (Sandbox Code Playgroud)

idx范围从0

但是我得到了 OverflowError: long int too large to convert to float

我试图将转换转换为float但没有结果.

python overflow factorial

23
推荐指数
3
解决办法
5万
查看次数

删除一些不良行

我有一个如下所示的文件,我想删除第四列中没有任何值的行.

Experiment Replica Module Mean
General1 0 scenario.host[229].app  
General1 1 scenario.host[229].app 0.00235355 
General1 2 scenario.host[229].app  
General1 3 scenario.host[229].app 0.0783413 
General1 4 scenario.host[229].app  
General3 0 scenario.host[229].app  
General3 1 scenario.host[229].app 0.540335 
General3 2 scenario.host[229].app  
General3 3 scenario.host[229].app  
General3 4 scenario.host[229].app  
General1 0 scenario.host[229].app  
Run Code Online (Sandbox Code Playgroud)

linux awk

0
推荐指数
1
解决办法
45
查看次数

标签 统计

awk ×1

factorial ×1

linux ×1

overflow ×1

python ×1