graph.py 文件源码

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

项目:py-graphart 作者: dandydarcy 项目源码 文件源码
def coords_edges(self, edges):
        '''
        Returns a list of coordinates head and tail points for all edge in edges
        '''
        res = np.empty((len(edges)), dtype=object)
        for r, e in zip(range(len(edges)), edges):
            if e[0] is None:
                e[0] = 0
            res[r] = self.coords_edge(e)
            if len(res[r][0]) != 2:
                print 'there is an error with the edges'
                import pdb
                pdb.set_trace()

        # v = np.vectorize(self.coords_edge, otypes=[np.object])
        # res = v(edges)
        return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号