arrayio.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:AdK_analysis 作者: orbeckst 项目源码 文件源码
def readFloatArrayWithSkip(filename, col):
    "Return a floating-point array containing the data from file |filename|."
    if not type(col) == list: col = [col]
    data = []
    from operator import getitem
    for line in TextFile(filename):
        if line[0] != '#':
            fields = string.split(line)
            data.append(map(string.atof, [fields[x] for x in col]))
    a = Numeric.array(data)
    if a.shape[0] == 1 or a.shape[1] == 1:
    a = Numeric.ravel(a)
    return a
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号