- 博客(4)
- 收藏
- 关注
原创 python构建多叉树及多叉树的倒序遍历
AllTreePath=[] class MultywayTree(): class Node():#初始化节点 def __init__(self,data): self.data=data self.child_list=[] self.parent=None def __init__(self,root):#初始化根节点 self.root=self.Node(root)
2020-09-13 18:10:55 2219
原创 用python列出当前文件夹下所有子文件路径(包括子文件夹内文件)
def list_dir(CurPath=os.getcwd(),file_list=[]): FileList=os.listdir(CurPath) #print FileList for File in FileList: SubPath=CurPath+'\\'+File if os.path.isdir(File): list_dir(SubPath,file_list) else:
2020-09-04 16:15:44 2106
原创 自建哈希表
class LinkList(): class Node(): def __init__(self,item=None): self.item=item self.next=None class LinkListIterator(): def __init__(self,node): self.node=node def next(self): if se
2020-09-04 11:12:26 331
原创 numpy数组按某列排序
numpy.argsort() 返回排序索引 a=a[np.argsort(a,axis=0)[:,2],] example: a=np.array([[3,4,3],[2,1,7],[2,3,4],[5,6,2]]) a array([[3, 4, 3], [2, 1, 7], [2, 3, 4], [5, 6, 2]]) a=a[np.argsort(a,axis=0)[:,2],] a array([[5, 6, 2], [3, 4, 3], [2, 3, 4], [2, 1, 7]])
2020-08-14 17:29:30 5936 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人