python概率计算_在python中如何计算可能性?

如果你只是要求数据V>0.5的概率,我会找到它的独立概率。正如我所评论的,我不认为数据之间存在相关性,因为data-V有一个峰值,而data-R根本没有反应。

import numpy as np

types = {"data_v": "data_v.csv"} # only considering data-V

for protname, fname in types.items(): # your code to load the data

col_time, col_window = np.loadtxt(fname, delimiter=',').T

trailing_window = col_window[:-1] # "past" values at a given index

leading_window = col_window[1:] # "current values at a given index

decreasing_inds = np.where(leading_window < trailing_window)[0]

quotient = leading_window[decreasing_inds] / trailing_window[decreasing_inds]

quotient_times = col_time[decreasing_inds]

# Now we'll go through the data for quotients and find how many meet the > 0.5 criteria

count = 0

for quot in quotient:

if quot > 0.5:

count +

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值