klustakwikio.py 文件源码

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

项目:NeoAnalysis 作者: neoanalysis 项目源码 文件源码
def _load_spike_times(self, fetfilename):
        """Reads and returns the spike times and features"""
        f = file(fetfilename, 'r')

        # Number of clustering features is integer on first line
        nbFeatures = int(f.readline().strip())

        # Each subsequent line consists of nbFeatures values, followed by
        # the spike time in samples.
        names = ['fet%d' % n for n in xrange(nbFeatures)]
        names.append('spike_time')

        # Load into recarray
        data = mlab.csv2rec(f, names=names, skiprows=1, delimiter=' ')
        f.close()

        # get features
        features = np.array([data['fet%d' % n] for n in xrange(nbFeatures)])

        # Return the spike_time column
        return data['spike_time'], features.transpose()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号