numpy:从屏蔽记录中查询数据?
我有这样的掩码记录
In [41]: x
Out[41]:
masked_records(
CHR : [12 12 12 ..., 12 12 12]
SNP : [rs4980929 rs4980929 rs4980929 ..., rs7975069 rs7975069 rs7975069]
A1 : [C C C ..., T T T]
A2 : [T T T ..., C C C]
TEST : [GENO TREND ALLELIC ..., ALLELIC DOM REC]
AFF : [51/126/92 228/310 228/310 ..., 190/350 158/112 32/238]
UNAFF : [51/136/83 238/302 238/302 ..., 180/362 148/123 32/239]
CHISQ : [0.8427 0.3124 0.3155 ..., 0.4688 0.8398 0.000248]
DF : [2 1 1 ..., 1 1 1]
P : [0.6562 0.5762 0.5744 ..., 0.4935 0.3594 0.9874]
fill_value : (999999, 'N/A', 'N', 'N', 'N/A', 'N/A', 'N/A', 1e+20, 999999, 1e+20)
如何从 P where TEST == 'GENO' 获取值?如果这有帮助,则“P”字段缺少值。
I have mask record like this
In [41]: x
Out[41]:
masked_records(
CHR : [12 12 12 ..., 12 12 12]
SNP : [rs4980929 rs4980929 rs4980929 ..., rs7975069 rs7975069 rs7975069]
A1 : [C C C ..., T T T]
A2 : [T T T ..., C C C]
TEST : [GENO TREND ALLELIC ..., ALLELIC DOM REC]
AFF : [51/126/92 228/310 228/310 ..., 190/350 158/112 32/238]
UNAFF : [51/136/83 238/302 238/302 ..., 180/362 148/123 32/239]
CHISQ : [0.8427 0.3124 0.3155 ..., 0.4688 0.8398 0.000248]
DF : [2 1 1 ..., 1 1 1]
P : [0.6562 0.5762 0.5744 ..., 0.4935 0.3594 0.9874]
fill_value : (999999, 'N/A', 'N', 'N', 'N/A', 'N/A', 'N/A', 1e+20, 999999, 1e+20)
How do I get value from P where TEST == 'GENO' ? If this help, 'P' field has a missing value.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它应该是简单的
x['P'][x['TEST'] == 'GENO']
例如
It should be as simple a
x['P'][x['TEST'] == 'GENO']
e.g.